<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>汽车衡称重系统</title>
	<link href="__STATIC__/css/common.css" rel="stylesheet">
	<link rel="stylesheet" href="__STATIC__/css/index.css">
	<link rel="stylesheet" type="text/css" href="__STATIC__/js/datetimepicker/jquery.datetimepicker.css"/>
	<style>
		.ms-controller{
			display:none;
		}
	</style>
	<script src="__STATIC__/js/LodopFuncs.js"></script>
	<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
	  <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
	</object>
	
</head>
<body ms-controller="view" class="ms-controller" ms-visible="display_main">
	<div class="header">
		<div class="header-box">
			<ul class="menu-box">
				<li class="menu-item" ms-class="menu-active:menu_label == 'scale'" ms-click="changeMenu('scale')">称重</li>
				<li class="menu-item" ms-class="menu-active:menu_label == 'system'" ms-click="changeMenu('system')">系统维护</li>
				<li class="menu-item" ms-class="menu-active:menu_label == 'report'" ms-click="changeMenu('report')">统计报表</li>
				<li class="menu-item" ms-class="menu-active:menu_label == 'function'" ms-click="changeMenu('function')">财务核算</li>
				<li class="menu-item"><a style="color:blue;" target="_blank" href="/home/index/insertByHand">手动补单</a></li>
			</ul>
		</div>
	</div>
	<div class="main">
		<div class="content" ms-visible="menu_label == 'scale'">
			<div class="weigh_tab" ms-visible="weigh_display_str == 'weigh'">
				<div class="scale-menu-button">
					<div class="btn-weigh" style="margin-left:2px;" ms-click="toSignin">
						<img src="__STATIC__/img/menu/huanban.png" alt="" class="btn-img">
						<span class="btn-text">换&nbsp;&nbsp;&nbsp;&nbsp;班</span>
					</div>
					<div class="btn-fenge"></div>
					<div class="btn-weigh" ms-click="toReset">
						<img src="__STATIC__/img/menu/baobiao.png" alt="" class="btn-img">
						<span class="btn-text">仪表清零</span>
					</div>
					<div class="btn-fenge"></div>
					<div class="btn-weigh"  ms-click="changebillDate">
						<img src="__STATIC__/img/menu/jb.png" alt="" class="btn-img">
						<span class="btn-text">交&nbsp;&nbsp;&nbsp;&nbsp;班</span>
					</div>
					<div class="btn-fenge"></div>
					<div class="btn-weigh">
						<img src="__STATIC__/img/menu/chaxun.png" alt="" class="btn-img">
						<span class="btn-text">端口重置</span>
					</div>
					<div class="btn-fenge"></div>
					<div class="btn-weigh" ms-click="userLocked">
						<img src="__STATIC__/img/menu/suoding.png" alt="" class="btn-img">
						<span class="btn-text">屏幕锁定</span>
					</div>
					<div class="btn-fenge"></div>
					<!-- <div class="btn-weigh">
						<img src="__STATIC__/img/menu/kongche.png" alt="" class="btn-img">
						<span class="btn-text">空车过磅</span>
					</div> -->
					<p class="weigh-number" id="weigh-number" ms-class="(|weigh_class|)" ms-text="weigh"></p>
					<div class="btn-fenge"></div>
					<div class="btn-weigh">
						<img src="__STATIC__/img/menu/zhongche.png" alt="" class="btn-img">
						<span class="btn-text">重车过磅</span>
					</div>
					<div class="btn-fenge"></div>
					<div class="btn-weigh" ms-click="exitProgram">
						<img src="__STATIC__/img/menu/tuichu.png" alt="" class="btn-img">
						<span class="btn-text">退&nbsp;&nbsp;&nbsp;&nbsp;出</span>
					</div>
					
					<div class="btn-fenge"></div>
					<div class="btn-weigh-tel">
						开发者QQ:8870079<br/>电话:18630391129
					</div>
				</div>
				<table class="show-result" cellspacing="0" border="1px">
					<tr>
						<th>磅单编号</th>
						<th>过磅日期</th>
						<th>车牌号码</th>
						<th>司机姓名</th>
						<th>物资名称</th>
						<th>毛&nbsp;&nbsp;&nbsp;&nbsp;重</th>
						<th>检毛时间</th>
						<th>皮&nbsp;&nbsp;&nbsp;&nbsp;重</th>
						<th>检皮时间</th>
						<th>净&nbsp;&nbsp;&nbsp;&nbsp;重</th>
						<th>发货单位</th>
						<th>收货单位</th>
						<th>发货位置</th>
						<th>发运路线</th>
						<th>钩机号</th>
					</tr>
					<tr>
						<td ms-text="item.billCode"></td>
						<td ms-text="item.billDate"></td>
						<td ms-text="item.truckCode"></td>
						<td ms-text="item.driver"></td>
						<td ms-text="item.goodsName"></td>
						<td ms-text="item.fullWeigh" ms-class="tuchu:item.fullWeigh > 0"></td>
						<td ms-text="item.fullTime"></td>
						<td ms-text="item.emptyWeigh" ms-class="tuchu:item.emptyWeigh > 0"></td>
						<td ms-text="item.emptyTime"></td>
						<td ms-text="item.weigh" ms-class="tuchu:item.weigh > 0"></td>
						<td ms-text="item.sendUnit"></td>
						<td ms-text="item.receiveUnit"></td>
						<td ms-text="item.position"></td>
						<td ms-text="item.route"></td>
						<td ms-text="item.excavator"></td>
					</tr>
				</table>
				<ul class="scale-table">
					<li class="scale-table-items " ms-class="scale-table-items-active:menu_sub.scale == 'empty'" ms-visible="config.weighModel == 1" ms-click="changeScaleType('empty',1)">皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</li>
					<li class="scale-table-items" ms-class="scale-table-items-active:menu_sub.scale == 'pre-empty'" ms-visible="config.weighModel == 0" ms-click="changeScaleType('pre-empty',1)">预存皮重</li>
					<li class="scale-table-items" ms-class="scale-table-items-active:menu_sub.scale == 'full'" ms-click="changeScaleType('full',0)" style="border-right:1px solid gray;">毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</li>
					<li class="scale-table-selector" style="width:150px;"></li>
					<li class="scale-table-selector">
						<input type="radio" name="weighmodel" value="0" ms-duplex-string="config.weighModel" ms-change="changeConfig()">预存车皮
						<input type="radio" name="weighmodel" value="1" ms-duplex-string="config.weighModel" ms-change="changeConfig()">车车回皮
					</li>
					<li class="scale-table-selector" style="width:50px;"></li>
					<li class="scale-table-selector">
						<input type="radio" name="truckCode" value="1" ms-duplex-string="config.codeType" ms-change="changeCodeType()">正式车牌
						<input type="radio" name="truckCode" value="0" ms-duplex-string="config.codeType" ms-click="test" ms-change="changeCodeType()">临时车牌
					</li>
					<li class="scale-table-selector" style="width:100px;"></li>
					<li class="scale-table-selector">
						<span ms-text="'当前司磅员:' + user_info.userName" style="font-size:18px;color:blue;line-height:30px;font-weight:bold;"></span>
					</li>
					<li style="clear:both;"></li>
				</ul>
				<div class="scale-box">
					<table class="scale-data" ms-visible="menu_sub.scale == 'pre-empty'" border="0">
						<tr>
							<td class="data-text">检皮日期:</td>
							<td class="data-data1"><input type="text" class="scale-input" readonly="true" ms-duplex="item.billDate"></td>
							<td class="data-space"></td>
						</tr>
						<tr>
							<td class="data-text">车牌号码:</td>
							<td class="data-data1">
								<select style="width:20%;height:30px;display:inline-block;font-size:16px;" ms-duplex="truck_code_left">
									<option value="">请选择</option>
									<option ms-repeat-el="truck_code_list" ms-attr-value="el.codeName">(|el.codeName|)</option>
								</select>
								<input type="text" class="scale-input" ms-attr-maxlength="config.codeLen" style="display:inline-block;width:73%;height:26px;margin-left:1%;" ms-duplex="item.truckCode" ms-keyup="searchTruck()" />
							</td>
							<td class="data-space"></td>
						</tr>
						<tr>
							<td class="data-text">车辆型号:</td>
							<td class="data-data1">
								<select style="width:100%;font-size:18px;height:30px;" disabled="disabled" ms-duplex="item.truckType">
									<option value="">请选择</option>
									<option ms-repeat-el="truck_type_list" ms-attr-value="el.typeName">(|el.typeName|)</option>
								</select>
							</td>
							<td class="data-space"></td>
						</tr>
						<tr>
							<td class="data-text">司机姓名:</td>
							<td class="data-data1"><input type="text" class="scale-input"  readonly="true" ms-duplex="item.driver"></td>
							<td class="data-space"></td>
						</tr>
						<tr>
							<td class="data-text">皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重:</td>
							<td class="data-data1"><input type="text" class="scale-input"  readonly="true" ms-duplex="item.emptyWeigh"></td>
							<td class="data-space"></td>
						</tr>
					</table>
					<table class="scale-data" border="0" ms-visible="menu_sub.scale != 'pre-empty'">
						<tr>
							<td class="data-text">磅单编号:</td>
							<td class="data-data"><input type="text" class="scale-input" ms-attr-readonly="item_disable.billCode" ms-duplex="item.billCode" /></td>
							<td class="data-text">毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重:</td>
							<td class="data-data"><input type="text" class="scale-input" ms-attr-readonly="item_disable.fullWeigh" ms-duplex="item.fullWeigh" /></td>
						</tr>
						<tr>
							<td class="data-text">车牌号码:</td>
							<td class="data-data">
								<select style="width:20%;height:30px;display:inline-block;font-size:16px;" ms-duplex="truck_code_left">
									<option value="">选择</option>
									<option ms-repeat-el="truck_code_list" ms-attr-value="el.codeName">(|el.codeName|)</option>
								</select>
								<input type="text" class="scale-input" ms-attr-maxlength="config.codeLen" style="display:inline-block;width:73%;height:26px;margin-left:1%;" ms-duplex="item.truckCode" ms-keyup="searchTruck()" />
							</td>
							<td class="data-text">皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重:</td>
							<td class="data-data"><input type="text" class="scale-input" ms-attr-readonly="item_disable.emptyWeigh" ms-duplex="item.emptyWeigh" /></td>
						</tr>
						<tr>
							<td class="data-text">物资名称:</td>
							<td class="data-data">
								<select style="width:100%;height:30px;display:inline-block;font-size:16px;" ms-attr-disabled="item_disable.goodsName" ms-duplex="item.goodsName">
									<option value="" disabled>请选择</option>
									<option ms-repeat-el="goods_list" ms-attr-value="el.goodsName">(|el.goodsName|)</option>
								</select>
							</td>
							<td class="data-text">净&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重:</td>
							<td class="data-data"><input type="text" class="scale-input" ms-attr-readonly="item_disable.weigh" ms-duplex="item.weigh" /></td>
						</tr>
						<tr>
							<td class="data-text">司机姓名:</td>
							<td class="data-data"><input type="text" class="scale-input" ms-attr-readonly="item_disable.driver" ms-duplex="item.driver" /></td>
							<td class="data-text">发货单位:</td>
							<td class="data-data">
								<select style="width:100%;height:30px;display:inline-block;font-size:16px;" ms-attr-disabled="item_disable.receiveUnit" ms-duplex="item.sendUnit" ms-change="getPositionSelect">
									<option value="" disabled>请选择</option>
									<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="data-text">钩机号码:</td>
							<td class="data-data">
								<select style="width:100%;height:30px;display:inline-block;font-size:16px;" ms-attr-disabled="item_disable.excavator" ms-duplex="item.excavator">
									<option value="">无</option>
									<option ms-repeat-el="excavator_list" ms-attr-value="el.excavatorCode">(|el.excavatorCode|)</option>
								</select>
							</td>
							<td class="data-text">收货单位:</td>
							<td class="data-data">
								<select style="width:100%;height:30px;display:inline-block;font-size:16px;" ms-attr-disabled="item_disable.sendUnit" ms-duplex="item.receiveUnit">
									<option value="" disabled>请选择</option>
									<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="data-text">车辆型号:</td>
							<td class="data-data">
								<select style="width:100%;font-size:16px;height:30px;" ms-attr-disabled="item_disable.truckType" ms-duplex="item.truckType">
									<option value="" disabled>请选择</option>
									<option ms-repeat-el="truck_type_list" ms-attr-value="el.typeName">(|el.typeName|)</option>
								</select>
							</td>
							<td class="data-text">发货位置:</td>
							<td class="data-data">
								<select style="width:100%;font-size:16px;height:30px;" ms-duplex="item.position" ms-attr-disabled="item_disable.position">
									<option value="">无</option>
									<option ms-repeat-el="position_select" ms-attr-value="el.position">(|el.position|)</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="data-text">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</td>
							<td class="data-data"><input type="text" class="scale-input" ms-attr-readonly="item_disable.mem" style="width:100%;"  ms-duplex="item.mem" /></td>
							<td class="data-text">发运路线:</td>
							<td class="data-data">
								<select style="width:100%;font-size:16px;height:30px;" ms-attr-disabled="item_disable.route" ms-duplex="item.route">
									<option value="">无</option>
									<option ms-repeat-el="route_list" ms-attr-value="el.route">(|el.route|)</option>
								</select>
							</td>
						</tr>
						<tr>
							<td class="data-text"><span>检皮人员:&nbsp;&nbsp;</span></td>
							<td><span ms-text="item.emptyOperator"></span></td>
							<td class="data-text"><span>检皮时间:&nbsp;&nbsp;</span></td>
							<td><span  ms-text="item.emptyTimeDesc"></span></td>
						</tr>
						<tr>
							<td class="data-text"><span>检毛人员:&nbsp;&nbsp;</span></td>
							<td><span ms-text="item.fullOperator"></span></td>
							<td class="data-text"><span>检毛时间:&nbsp;&nbsp;</span></td>
							<td><span ms-text="item.fullTimeDesc"></span></td>
						</tr>
					</table>
					<div class="scale-enter">
						<button class="scale-button" ms-click="getEmptyList">皮重记录</button>	
						<button class="scale-button" ms-click="getFullList">毛重记录</button>
						<button class="scale-button" ms-click="getWaiteList">待磅车辆</button>
						<button class="scale-button" ms-click="getWeighList">当日净重</button>
						<button class="scale-button eck" ms-attr-disabled="button_disable.enter" ms-class="gray:button_disable.enter" ms-click="lockData()" >确&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;认</button>
						<button class="scale-button eck" ms-attr-disabled="button_disable.save" ms-class="gray:button_disable.save" ms-click="saveData()">保&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;存</button>
						<button class="scale-button eck" ms-attr-disabled="button_disable.print" ms-class="gray:button_disable.print" ms-click="printData()">打&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;印</button>
						<button class="scale-button eck" ms-attr-disabled="button_disable.goon" ms-class="gray:button_disable.goon" ms-click="goon()">继&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;续</button>
						<button class="scale-button eck" ms-click="printStr">打印测试</button>			
					</div>
					<div style="width:266px;height:418px;float:left;border:1px solid #A0A0A0;">
						<div class="ace">
							<div id="divPlugin">
								
							</div>
							<ul style="margin:0;padding:0;width:100%;">
								<li class="count-item">
									<input type="checkbox" style="display:inline-block;margin-left:20px;" ms-duplex-checked="only_current" ms-change="getCountList"><span class="count-item-unit">只统计当前过磅员</span>
									<button class="scale-button" style="margin-left:5px;" ms-click="getCountList">刷新统计</button>
								</li>
								<li class="count-item">
									<span class="count-item-title">当日过皮车数:</span>
									<span class="count-item-data" ms-text="countItem.emptyCounts"></span>
									<span class="count-item-unit">车</span>
								</li>
								<li class="count-item">
									<span class="count-item-title">当日过毛车数:</span>
									<span class="count-item-data" ms-text="countItem.fullCounts"></span>
									<span class="count-item-unit">车</span>
								</li>
								<li class="count-item">
									<span class="count-item-title">当日净重车数:</span>
									<span class="count-item-data" ms-text="countItem.weighCounts"></span>
									<span class="count-item-unit">车</span>
								</li>
								<li class="">
									<span class="count-item-title">发货单位:</span>
									<select style="width:140px;height:26px;" ms-duplex="countInput.sendUnit" ms-change="getCountList">
										<option value="">不&nbsp;&nbsp;&nbsp;&nbsp;限</option>
										<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
									</select>
								</li>
								<li class="">
									<span class="count-item-title">收货单位:</span>
									<select style="width:140px;height:26px;" ms-duplex="countInput.receiveUnit" ms-change="getCountList">
										<option value="">不&nbsp;&nbsp;&nbsp;&nbsp;限</option>
										<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
									</select>
								</li>
								<li class="">
									<span class="count-item-title">物资名称:</span>
									<select style="width:140px;height:26px;" ms-duplex="countInput.goodsName" ms-change="getCountList">
										<option value="">不&nbsp;&nbsp;&nbsp;&nbsp;限</option>
										<option ms-repeat-el="goods_list" ms-attr-value="el.goodsName">(|el.goodsName|)</option>
									</select>
								</li>
								<li class="">
									<span class="count-item-title">总重量:</span>
									<span class="count-item-data" style="width:140px;" ms-text="countItem.weighSum"></span>
									<span class="count-item-unit">吨</span>
								</li>
								<li class="top-10">
									<button class="scale-button" style="margin-left:90px;" ms-click="getCountList">刷新统计</button>
								</li>
							</ul>
						</div>
					</div>
					<div style="clear:both;"></div>
				</div>
			</div>
			<div class="list-box" id="list-box-id" ms-visible="list_display == true">
				<div class="mask_layer" ms-visible="weigh_edit_display">
					<div class="weigh_edit_box">
						<table class="scale-data" border="0" ms-visible="menu_sub.scale != 'pre-empty'">
									<tr>
										<td class="data-text noopa">磅单编号:</td>
										<td class="data-data"><input type="text" class="scale-input" readonly="true" ms-duplex="weigh_edit.billCode" /></td>
										<td class="data-text noopa">毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重:</td>
										<td class="data-data"><input type="text" class="scale-input" readonly="true" ms-duplex="weigh_edit.fullWeigh" /></td>
									</tr>
									<tr>
										<td class="data-text noopa">车牌号码:</td>
										<td class="data-data">
											<input type="text" class="scale-input" readonly="true" ms-duplex="weigh_edit.truckCode" />
										</td>
										<td class="data-text noopa">皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重:</td>
										<td class="data-data"><input type="text" class="scale-input" readonly="true" ms-duplex="weigh_edit.emptyWeigh" /></td>
									</tr>
									<tr>
										<td class="data-text noopa">物资名称:</td>
										<td class="data-data">
											<select style="width:100%;height:30px;display:inline-block;font-size:16px;" ms-duplex="weigh_edit.goodsName">
												<option value="">请选择</option>
												<option ms-repeat-el="goods_list" ms-attr-value="el.goodsName">(|el.goodsName|)</option>
											</select>
										</td>
										<td class="data-text noopa">净&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重:</td>
										<td class="data-data"><input type="text" class="scale-input" readonly="true" ms-duplex="weigh_edit.weigh" /></td>
									</tr>
									<tr>
										<td class="data-text noopa">司机姓名:</td>
										<td class="data-data"><input type="text" class="scale-input" ms-duplex="weigh_edit.driver" /></td>
										<td class="data-text noopa">发货单位:</td>
										<td class="data-data">
											<select style="width:100%;height:30px;display:inline-block;font-size:16px;" ms-duplex="weigh_edit.sendUnit" ms-change="getEditPositionList">
												<option value="">请选择</option>
												<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
											</select>
										</td>
									</tr>
									<tr>
										<td class="data-text noopa">钩机号码:</td>
										<td class="data-data">
											<select style="width:100%;height:30px;display:inline-block;font-size:16px;" ms-duplex="weigh_edit.excavator">
												<option value="">请选择</option>
												<option ms-repeat-el="excavator_list" ms-attr-value="el.excavatorCode">(|el.excavatorCode|)</option>
											</select>
										</td>
										<td class="data-text noopa">发货位置:</td>
										<td class="data-data">
											<select style="width:100%;font-size:16px;height:30px;" ms-duplex="weigh_edit.position">
												<option value="">请选择</option>
												<option ms-repeat-el="position_edit_select" ms-attr-value="el.position">(|el.position|)</option>
											</select>
										</td>
									</tr>
									<tr>
										<td class="data-text noopa">车辆型号:</td>
										<td class="data-data">
											<select style="width:100%;font-size:16px;height:30px;" ms-duplex="weigh_edit.truckType">
												<option value="">请选择</option>
												<option ms-repeat-el="truck_type_list" ms-attr-value="el.typeName">(|el.typeName|)</option>
											</select>
										</td>
										<td class="data-text noopa">收货单位:</td>
										<td class="data-data">
											<select style="width:100%;height:30px;display:inline-block;font-size:16px;" ms-duplex="weigh_edit.receiveUnit">
												<option value="">请选择</option>
												<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
											</select>
										</td>
									</tr>
									<tr>
										<td class="data-text noopa">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</td>
										<td class="data-data">
											<input type="text" class="scale-input" style="width:100%;"  ms-duplex="weigh_edit.mem" />
										</td>
										<td class="data-text noopa">发运路线:</td>
										<td class="data-data">
											<select style="width:100%;font-size:16px;height:30px;" ms-duplex="weigh_edit.route">
												<option value="">请选择</option>
												<option ms-repeat-el="route_list" ms-attr-value="el.route">(|el.route|)</option>
											</select>
										</td>
									</tr>
									<tr>
										<td colspan="4"style="align:center;">
											<div style="width:100%;align:center;margin-top:20px;">
												<button class="btn-mask left-250" ms-click="editBillSave">保存</button>
												<button class="btn-mask left-130" ms-click="editBillCancel">返回</button>
											</div>
											
										</td>
									</tr>
								</table>
					</div>
				</div>

				<div id="rightMenu" class="rightMenu" class="ms-controller" ms-visible="weigh_menu.display" ms-mouseleave="hideWeighMenu">
					<ul>
						<li ms-repeat-el="weigh_menu.item" class="right-menu-item" ms-class="(|el.class|)" ms-text="el.text" ms-click="menuSelect($event,$index,el.value,el.power)"></li>
					</ul>
				</div>
				<div class="weigh_tab" ms-visible="list_display_str == 'empty_list'">
					<div class="function_box" style="text-align:right;">
						<button style="display:inline-block;width:100px;height:30px;background-color:#1ABC9C;color:white;margin-left:20px;" ms-click="cancelWeighList">返回</button>
					</div>
					<div class="weigh_list_box">
						<p style="margin-top:20px;text-align:center;font-size:16px;color:red;" ms-visible="weigh_list.length <= 0">没有查到任何记录</p>
						<table class="weigh_list" border="1" cellspacing="0" ms-visible="weigh_list.length > 0" style="font-size:14px;table-layout:fixed">
							<tr>
								<th>编号</th>
								<th>磅单编号</th>
								<th>过磅日期</th>
								<th>物资名称</th>
								<th>车牌号码</th>
								<th>司机姓名</th>
								<th>皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>检皮时间</th>
								<th>检皮人员</th>
								<th>毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>检重时间</th>
								<th>检重人员</th>
								<th>净&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>发货单位</th>
								<th>收货单位</th>
								<th>发货位置</th>
								<th>发运路线</th>
								<th>钩机号</th>
								<th>磅房名称</th>
								<th>打印次数</th>
							</tr>
							<tr ms-repeat-el=weigh_list ms-mouseup="getMouseButton($event,el)" ms-class="(|el.bg|)">
								<td ms-text="$index + 1"></td>
								<td ms-text="el.billCode"></td>
								<td ms-text="el.billDateDesc"></td>
								<td ms-text="el.goodsName"></td>
								<td ms-text="el.truckCode"></td>
								<td ms-text="el.driver"></td>
								<td ms-text="el.emptyWeigh"></td>
								<td ms-text="el.emptyTimeDesc"></td>
								<td ms-text="el.emptyOperator"></td>
								<td ms-text="el.fullWeigh"></td>
								<td ms-text="el.fullTimeDesc"></td>
								<td ms-text="el.fullOperator"></td>
								<td ms-text="el.weigh"></td>
								<td ms-text="el.sendUnit"></td>
								<td ms-text="el.receiveUnit"></td>
								<td ms-text="el.position"></td>
								<td ms-text="el.route"></td>
								<td ms-text="el.excavator"></td>
								<td ms-text="el.houseName"></td>
								<td ms-text="el.printCount"></td>
							</tr>
						</table>
					</div>
				</div>

				<div class="weigh_tab" ms-visible="list_display_str == 'full_list'">
					<div class="function_box" style="text-align:right;">
						<button style="display:inline-block;width:100px;height:30px;background-color:#1ABC9C;color:white;margin-left:20px;" ms-click="cancelWeighList">返回</button>
					</div>
					<div class="weigh_list_box">
						<p style="margin-top:20px;text-align:center;font-size:16px;color:red;" ms-visible="weigh_list.length <= 0">没有查到任何记录</p>
						<table class="weigh_list" border="1" cellspacing="0" ms-visible="weigh_list.length > 0" style="font-size:14px;table-layout:fixed">
							<tr>
								<th>编号</th>
								<th>磅单编号</th>
								<th>过磅日期</th>
								<th>物资名称</th>
								<th>车牌号码</th>
								<th>司机姓名</th>
								<th>皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>检皮时间</th>
								<th>检皮人员</th>
								<th>毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>检重时间</th>
								<th>检重人员</th>
								<th>净&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>发货单位</th>
								<th>收货单位</th>
								<th>发货位置</th>
								<th>发运路线</th>
								<th>钩机号</th>
								<th>磅房名称</th>
								<th>打印次数</th>
							</tr>
							<tr ms-repeat-el=weigh_list ms-mouseup="getMouseButton($event,el)" ms-class="(|el.bg|)">
								<td ms-text="$index + 1"></td>
								<td ms-text="el.billCode"></td>
								<td ms-text="el.billDateDesc"></td>
								<td ms-text="el.goodsName"></td>
								<td ms-text="el.truckCode"></td>
								<td ms-text="el.driver"></td>
								<td ms-text="el.emptyWeigh"></td>
								<td ms-text="el.emptyTimeDesc"></td>
								<td ms-text="el.emptyOperator"></td>
								<td ms-text="el.fullWeigh"></td>
								<td ms-text="el.fullTimeDesc"></td>
								<td ms-text="el.fullOperator"></td>
								<td ms-text="el.weigh"></td>
								<td ms-text="el.sendUnit"></td>
								<td ms-text="el.receiveUnit"></td>
								<td ms-text="el.position"></td>
								<td ms-text="el.route"></td>
								<td ms-text="el.excavator"></td>
								<td ms-text="el.houseName"></td>
								<td ms-text="el.printCount"></td>
							</tr>
						</table>
					</div>
				</div>

				<div class="weigh_tab" ms-visible="list_display_str == 'toWeigh_list'">
					<div class="function_box" style="text-align:right;">
						<button style="display:inline-block;width:100px;height:30px;background-color:#1ABC9C;color:white;margin-left:20px;" ms-click="cancelWeighList">返回</button>
					</div>
					<div class="weigh_list_box">
						<p style="margin-top:20px;text-align:center;font-size:16px;color:red;" ms-visible="weigh_list.length <= 0">没有查到任何记录</p>
						<table class="weigh_list" border="1" cellspacing="0" ms-visible="weigh_list.length > 0" style="font-size:14px;table-layout:fixed">
							<tr>
								<th>编号</th>
								<th>磅单编号</th>
								<th>过磅日期</th>
								<th>物资名称</th>
								<th>车牌号码</th>
								<th>司机姓名</th>
								<th>皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>检皮时间</th>
								<th>检皮人员</th>
								<th>毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>检重时间</th>
								<th>检重人员</th>
								<th>净&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>发货单位</th>
								<th>收货单位</th>
								<th>发货位置</th>
								<th>发运路线</th>
								<th>钩机号</th>
								<th>磅房名称</th>
								<th>打印次数</th>
							</tr>
							<tr ms-repeat-el=weigh_list ms-mouseup="getMouseButton($event,el)" ms-class="(|el.bg|)">
								<td ms-text="$index + 1"></td>
								<td ms-text="el.billCode"></td>
								<td ms-text="el.billDateDesc"></td>
								<td ms-text="el.goodsName"></td>
								<td ms-text="el.truckCode"></td>
								<td ms-text="el.driver"></td>
								<td ms-text="el.emptyWeigh"></td>
								<td ms-text="el.emptyTimeDesc"></td>
								<td ms-text="el.emptyOperator"></td>
								<td ms-text="el.fullWeigh"></td>
								<td ms-text="el.fullTimeDesc"></td>
								<td ms-text="el.fullOperator"></td>
								<td ms-text="el.weigh"></td>
								<td ms-text="el.sendUnit"></td>
								<td ms-text="el.receiveUnit"></td>
								<td ms-text="el.position"></td>
								<td ms-text="el.route"></td>
								<td ms-text="el.excavator"></td>
								<td ms-text="el.houseName"></td>
								<td ms-text="el.printCount"></td>
							</tr>
						</table>
					</div>
				</div>

				<div class="weigh_tab" ms-visible="list_display_str == 'weigh_list'">
					<div class="function_box">
						<input type="text" id="weigh_search_date" class="function_input" ms-duplex="weigh_search.date">
						<select ms-duplex="weigh_search.operator" class="function_input" style="height:30px !important;">
							<option value="">不限</option>
							<option ms-repeat-el="user_list" ms-attr-value="el.userName">(|el.userName|)</option>
						</select>
						<button style="display:inline-block;width:100px;height:30px;background-color:#1ABC9C;color:white;margin-left:20px;" ms-click="billSearch">查询</button>
						<button style="display:inline-block;width:100px;height:30px;background-color:#1ABC9C;color:white;margin-left:20px;" ms-click="cancelWeighList">返回</button>
					</div>
					<p style="margin-top:20px;text-align:center;font-size:16px;color:red;" ms-visible="weigh_list.length <= 0">没有查到任何记录</p>
					<div class="weigh_list_box">
						<table class="weigh_list" border="1" cellspacing="0" ms-visible="weigh_list.length > 0" style="font-size:14px;table-layout:fixed">
							<tr>
								<th>编号</th>
								<th>磅单编号</th>
								<th>过磅日期</th>
								<th>物资名称</th>
								<th>车牌号码</th>
								<th>司机姓名</th>
								<th>皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>检皮时间</th>
								<th>检皮人员</th>
								<th>毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>检重时间</th>
								<th>检重人员</th>
								<th>净&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
								<th>发货单位</th>
								<th>收货单位</th>
								<th>发货位置</th>
								<th>发运路线</th>
								<th>钩机号</th>
								<th>磅房名称</th>
								<th>打印次数</th>
							</tr>
							<tr ms-repeat-el=weigh_list ms-mouseup="getMouseButton($event,el)" ms-class="(|el.bg|)">
								<td ms-text="$index + 1"></td>
								<td ms-text="el.billCode"></td>
								<td ms-text="el.billDateDesc"></td>
								<td ms-text="el.goodsName"></td>
								<td ms-text="el.truckCode"></td>
								<td ms-text="el.driver"></td>
								<td ms-text="el.emptyWeigh"></td>
								<td ms-text="el.emptyTimeDesc"></td>
								<td ms-text="el.emptyOperator"></td>
								<td ms-text="el.fullWeigh"></td>
								<td ms-text="el.fullTimeDesc"></td>
								<td ms-text="el.fullOperator"></td>
								<td ms-text="el.weigh"></td>
								<td ms-text="el.sendUnit"></td>
								<td ms-text="el.receiveUnit"></td>
								<td ms-text="el.position"></td>
								<td ms-text="el.route"></td>
								<td ms-text="el.excavator"></td>
								<td ms-text="el.houseName"></td>
								<td ms-text="el.printCount"></td>
							</tr>
						</table>
					</div>
					
				</div>

			</div>		
				
		</div>
		
		<div class="main-report" ms-visible="menu_label == 'report'">
			<select style="width:400px;height:30px;margin-top:10px;text-align:center;margin-bottom:10px;display:none;" ms-change="selectReport" ms-duplex="report_model">
				<option style="width:100%;text-align:center;" value="normalReport">普通报表</option>
				<option style="width:100%;text-align:center;" value="countReport">统计报表</option>
			</select>
			<div class="report-box" ms-visible="report_model == 'normalReport'">
				<div style="width:99%;margin:0 auto;height:30px;padding-top:10px;padding-bottom:10px;border:1px solid #dedede;margin-bottom:10px;" ms-visible="config.timeAreareport == 0">
					<label class="function_input" style="margin-left:5px;">磅房：
						<select  class="function_input" style="width:90px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.houseId">
							<option value="">不限</option>
							<option ms-repeat-el="house_list" ms-attr-value="el.houseId">(|el.houseName|)</option>
						</select>
					</label>					
					<label class="function_input" style="margin-left:5px;">日期：
						<input type="text" id="datetimepicker_dark" class="function_input" style="width:110px;" ms-change="getNormalReport" ms-duplex="normal_search.billDate">
					</label>
					<label class="function_input" style="margin-left:5px;">物资名称：
						<select  class="function_input" style="width:70px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.goodsName">
							<option value="">不限</option>
							<option ms-repeat-el="goods_list" ms-attr-value="el.goodsName">(|el.goodsName|)</option>
						</select>
					</label>
					<label class="function_input" style="margin-left:5px;">发货单位：
						<select  class="function_input" style="width:100px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.sendUnit">
							<option value="">不限</option>
							<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
						</select>
					</label>
					<label class="function_input" style="margin-left:5px;">收货单位：
						<select  class="function_input" style="width:100px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.receiveUnit">
							<option value="">不限</option>
							<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
						</select>
					</label>
					<label class="function_input" style="margin-left:5px;">操作员：
						<select  class="function_input" style="width:70px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.fullOperator">
							<option value="">不限</option>
							<option ms-repeat-el="user_list" ms-attr-value="el.userName">(|el.userName|)</option>
						</select>
					</label>
					<button style="width:60px;height:30px;line-height:30px;background-color:#44B549;color:white;border-radius:4px;" ms-click="getNormalReport">刷新</button>
					<button style="width:60px;height:30px;line-height:30px;background-color:#44B549;color:white;border-radius:4px;margin-left:5px;" ms-click="printDailyReport('daily_report')">打印</button>
					<button style="width:60px;height:30px;line-height:30px;background-color:#44B549;color:white;border-radius:4px;margin-left:5px;" ms-click="exportNormalReport()">导出</button>
				</div>
				<div style="width:99%;margin:0 auto;height:30px;padding-top:10px;padding-bottom:10px;border:1px solid #dedede;margin-bottom:10px;" ms-visible="config.timeAreareport == 1">
					<label class="function_input" style="margin-left:3px;">磅房：
						<select  class="function_input" style="width:90px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.houseId">
							<option value="">不限</option>
							<option ms-repeat-el="house_list" ms-attr-value="el.houseId">(|el.houseName|)</option>
						</select>
					</label>					
					<label class="function_input" style="margin-left:3px;">开始日期：
						<input type="text" id="datetimepicker_dark_1" class="function_input" style="width:110px;" ms-change="getNormalReport" ms-duplex="normal_search.billDateStart">
					</label>
					<label class="function_input" style="margin-left:3px;">结束日期：
						<input type="text" id="datetimepicker_dark_2" class="function_input" style="width:110px;" ms-change="getNormalReport" ms-duplex="normal_search.billDateEnd">
					</label>
					<label class="function_input" style="margin-left:3px;">物资名称：
						<select  class="function_input" style="width:70px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.goodsName">
							<option value="">不限</option>
							<option ms-repeat-el="goods_list" ms-attr-value="el.goodsName">(|el.goodsName|)</option>
						</select>
					</label>
					<label class="function_input" style="margin-left:3px;">发货单位：
						<select  class="function_input" style="width:100px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.sendUnit">
							<option value="">不限</option>
							<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
						</select>
					</label>
					<label class="function_input" style="margin-left:3px;">收货单位：
						<select  class="function_input" style="width:100px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.receiveUnit">
							<option value="">不限</option>
							<option ms-repeat-el="customer_receive_list" ms-attr-value="el.customerName">(|el.customerName|)</option>
						</select>
					</label>
					<label class="function_input" style="margin-left:3px;">操作员：
						<select  class="function_input" style="width:70px;height:30px;" ms-change="getNormalReport" ms-duplex="normal_search.fullOperator">
							<option value="">不限</option>
							<option ms-repeat-el="user_list" ms-attr-value="el.userName">(|el.userName|)</option>
						</select>
					</label>
					<!-- <button style="width:60px;height:30px;line-height:30px;background-color:#44B549;color:white;border-radius:4px;" ms-click="getNormalReport">刷新</button> -->
					<button style="width:60px;height:30px;line-height:30px;background-color:#44B549;color:white;border-radius:4px;" ms-click="printDailyReport('daily_report')">打印</button>
					<button style="width:60px;height:30px;line-height:30px;background-color:#44B549;color:white;border-radius:4px;margin-left:5px;" ms-click="exportNormalReport()">导出</button>
				</div>
				<div class="report_list_box" id="daily_report">
					<p style="margin-top:20px;text-align:center;font-size:16px;color:red;" ms-visible="normal_report_list.length <= 0">没有查到任何记录</p>
					<table class="report_list" border="1" cellspacing="0" ms-visible="normal_report_list.length > 0" style="font-size:14px;table-layout:fixed;border-collapse:collapse;">
						<thead>
						<tr>
							<td colspan="20" style="border:0px !important;height:0px;">
								<h3 style="font-size:20px;text-align:center;margin-top:-25px;" ms-text="config.company + houseName + '过磅单日报表'"></h3>
							</td>
						</tr>
						<tr>
							<td colspan="20" style="border:0px;" align="center">
								当前是第<font tdata="PageNo">##</font>页&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共<font tdata="PageCount">##</font>页
							</td>
						</tr>
						<tr>
							<th>编号</th>
							<th>磅单编号</th>
							<th>过磅日期</th>
							<th>物资名称</th>
							<th>车牌号码</th>
							<th>司机姓名</th>
							<th>皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
							<th>检皮时间</th>
							<th>检皮人员</th>
							<th>毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
							<th>检重时间</th>
							<th>检重人员</th>
							<th>净&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
							<th>发货单位</th>
							<th>收货单位</th>
							<th>发货位置</th>
							<th>发运路线</th>
							<th>钩机号</th>
							<th>磅房名称</th>							
							<th>打印次数</th>
						</tr>
						</thead>
						<tbody>					
						<tr ms-repeat-el="normal_report_list" ms-class="(|el.bg|)">
							<td ms-text="$index + 1"></td>
							<td ms-text="el.billCode"></td>
							<td ms-text="el.billDateDesc"></td>
							<td ms-text="el.goodsName"></td>
							<td ms-text="el.truckCode"></td>
							<td ms-text="el.driver"></td>
							<td ms-text="el.emptyWeigh"></td>
							<td ms-text="el.emptyTimeDesc"></td>
							<td ms-text="el.emptyOperator"></td>
							<td ms-text="el.fullWeigh"></td>
							<td ms-text="el.fullTimeDesc"></td>
							<td ms-text="el.fullOperator"></td>
							<td ms-text="el.weigh"></td>
							<td ms-text="el.sendUnit"></td>
							<td ms-text="el.receiveUnit"></td>
							<td ms-text="el.position"></td>
							<td ms-text="el.route"></td>
							<td ms-text="el.excavator"></td>
							<td ms-text="el.houseName"></td>							
							<td ms-text="el.printCount"></td>
						</tr>
						
						<tr>
							<td colspan="20">
								<p style="display:inline-block;width:60%;height:40px;line-height:40px;font-size:20px;"></p>
								<p style="display:inline-block;width:15%;text-align:center;height:40px;line-height:40px;font-size:20px;"ms-text="'共' + normal_report_cs + '车'"></p>
								<p style="display:inline-block;width:15%;text-align:center;height:40px;line-height:40px;font-size:20px;" ms-text="'共' + normal_report_sum + '吨'"></p>
							</td>
						</tr>
						</tbody>
					</table>
					
				</div>
			</div>
			<div class="report-box" ms-visible="report_model == 'countReport'">
				
			</div>
		</div>
		<div class="content" ms-visible="menu_label == 'function'">function</div>
	</div>
	
	
	
	<div class="mask_layer" ms-visible="login_box_display">
		<div class="form-box" style="padding-bottom:50px;border-radius:10px;">
			<h2 style="width:100%;text-align:center;margin-top:40px;">切换用户</h2>
			<select class="login-item" style="height:30px;" ms-duplex="user_login.userName">
				<option value="">请选择用户名</option>
				<option ms-repeat-el="user_list" ms-attr-value="el.userName">(|el.userName|)</option>
			</select>
			<input type="password" class="login-item" placeholder="密码" style="height:30px;" ms-duplex="user_login.userPwd" />
			<button id="submit" style="width:100px;height:40px;background-color:#44B549;color:white;border:1px solid #44B549;border-radius:5px;margin-top:30px;" ms-click="signin">登  录</button>
			<button id="submit" style="width:100px;height:40px;background-color:#44B549;color:white;border:1px solid #44B549;border-radius:5px;margin-top:30px;" ms-click="unSignin">取  消</button>
		</div>
	</div>
	<div class="mask_layer" ms-visible="lock_box_display">
		<div class="form-box" style="padding-bottom:50px;border-radius:10px;">
			<h2 style="width:100%;text-align:center;margin-top:40px;">解除屏幕锁定</h2>
			<input type="text" class="login-item" placeholder="用户名" style="height:30px;" ms-duplex="user_login.userName" readonly="true" />
			<input type="password" class="login-item" placeholder="密码" style="height:30px;" ms-duplex="user_login.userPwd" />
			<button id="submit" style="width:100px;height:40px;background-color:#44B549;color:white;border:1px solid #44B549;border-radius:5px;margin-top:30px;" ms-click="signin($event,1)">解除锁定</button>
		</div>
	</div>
	<div class="mask_layer" ms-visible="change_dis == 'block'">
		<div id="change_box">
			<div class="change-top">
				<span class="select-text">请选择需要交班的记录,并点击交班按钮</span>
				<button class="btn" ms-click="changeAllList">全选</button>				
				<button class="btn left-40" ms-click="enterChangeBillDate">交班</button>
				<button class="btn left-40" ms-click="returnMain">返回</button>
			</div>
			<p style="margin-top:20px;text-align:center;font-size:16px;color:red;" ms-visible="change_list.length <= 0">没有可交班的磅单</p>
			<table class="change_list" border="1" cellspacing="0" ms-visible="change_list.length > 0" style="font-size:14px;table-layout:fixed">
				<tr>
					<th>选择</th>
					<th>过磅日期</th>
					<th>物资名称</th>
					<th>车牌号码</th>
					<th>司机姓名</th>
					<th>皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
					<th>检皮时间</th>
					<th>毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</th>
					<th>检重时间</th>
				</tr>
				<tr ms-repeat-el=change_list>
					<td align="center"><input type="checkbox" ms-attr-checked="el.select" ms-click="changeSelect($index)"></td>
					<td align="center" ms-text="el.billDateDesc"></td>
					<td align="center" ms-text="el.goodsName"></td>
					<td align="center" ms-text="el.truckCode"></td>
					<td align="center" ms-text="el.driver"></td>
					<td align="center" ms-text="el.emptyWeigh"></td>
					<td align="center" ms-text="el.emptyTimeDesc"></td>
					<td align="center" ms-text="el.fullWeigh"></td>
					<td align="center" ms-text="el.fullTimeDesc"></td>
				</tr>
			</table>
		</div>
		
	</div>
	<script src="__STATIC__/js/jquery.min.js"></script>
	<script src="__STATIC__/js/datetimepicker/build/jquery.datetimepicker.full.js"></script>
	<script src="__STATIC__/js/layer/layer.js"></script>
	<script src="__STATIC__/js/avalon.js"></script>
	<script src="__STATIC__/js/common.js"></script>
	<script src="__STATIC__/js/jquery.cookie.min.js"></script>
	<script src="__STATIC__/js/jQuery.md5.js"></script>
	<script src="__STATIC__/js/logic.js"></script>
	<script src="__STATIC__/js/validator.js"></script>
	<script src="__STATIC__/js/TComm-mini.js?t=2"></script>
	<script src="__STATIC__/js/video/codebase/webVideoCtrl.js"></script>
	<script src="__STATIC__/js/print.js"></script>
	
	<script>
	jQuery(document).ready(function(){
		console.log(new Date().Format('yyyy-MM-dd'));
		avalon.config({
          interpolate : ["(|","|)"]
        });
        $("#weigh_list").bind("contextmenu", function(){return false;});
        $("#rightMenu").bind("contextmenu", function(){return false;});
        $(".list-box").bind("contextmenu", function(){return false;});
        
		var Tcom = null;
		var w = $(document).width();
		var h = $(document).height();
		var lab = QueryString("lab");
		if(!lab){
			lab = 'scale';
		}
		/***
		VM中变量说明:
		config.weighModel:0为预存车皮,1为车车回皮
		weightype:0为毛重,1为皮重
		stable:仪表是否稳定,true为稳定,false为不稳定
		is_reset:仪表是否归零,true为归零,false为不归零
		houseId:磅房ID
		only_current:统计时是否只统计当前操作员的数据,true为只统计当前操作员,否则为false
		



		***/
		$.datetimepicker.setLocale('ch');
		$('#datetimepicker_dark').datetimepicker(
			{
				/*theme:'dark',*/
				timepicker:false,
				format:'Y-m-d',
				formatDate:'Y-m-d',
				defaultTime:'00:00',
				defaultDate:new Date().Format('yyyy-MM-dd'),
				/*onSelectDate:function(){
					vm.normal_search.billDate = $("#datetimepicker_dark").val();
					vm.getNormalReport();
				}*/
				onClose:function(){
					var td = $("#datetimepicker_dark").val();
					if(td != vm.normal_search.billDate){
						vm.normal_search.billDate = td;
						vm.getNormalReport();
					}
				}
			}
		);
		$('#datetimepicker_dark_1').datetimepicker(
			{
				/*theme:'dark',*/
				timepicker:true,
				format:'Y-m-d H:i',
				formatDate:'Y-m-d H:i',
				defaultTime:'00:00',
				defaultDate:new Date().Format('yyyy-MM-dd H:i'),
				onClose:function(){
					var td = $("#datetimepicker_dark_1").val();
					if(td != vm.normal_search.billDateStart){
						vm.normal_search.billDateStart = td;
						vm.getNormalReport();
					}
				}
			}
		);
		$('#datetimepicker_dark_2').datetimepicker(
			{
				/*theme:'dark',*/
				timepicker:true,
				format:'Y-m-d H:i',
				formatDate:'Y-m-d H:i',
				defaultTime:'00:00',
				defaultDate:new Date().Format('yyyy-MM-dd H:i'),
				onClose:function(){
					var td = $("#datetimepicker_dark_2").val();
					if(td != vm.normal_search.billDateEnd){
						vm.normal_search.billDateEnd = td;
						vm.getNormalReport();
					}
				}
			}
		);
		$("#weigh_search_date").datetimepicker(
			{
				/*theme:'dark',*/
				timepicker:false,
				format:'Y-m-d',
				formatDate:'Y-m-d',
				defaultTime:'00:00',
				defaultDate:new Date().Format('yyyy-MM-dd'),
				/*onSelectDate:function(){
					vm.weigh_search.date = $("#weigh_search_date").val();
				}*/
				onClose:function(){
					var td = $("#weigh_search_date").val();
					if(td != vm.weigh_search.date){
						vm.weigh_search.date = td;
					}
				}
			}
		);
		var sts = '';
		var canVideo = false;
		var isallow = true;
		var iRetx;
		iRetx = WebVideoCtrl.I_CheckPluginInstall();
		if (-1 == iRetx) {
			isallow = false;
			layer.alert("您还未安装过插件，双击开发包目录里的WebComponentsKit.exe安装！",{icon:3,skin: 'layer-ext-moon'});
		}else {
			isallow = true;
		}
		var oPlugin = {
			iWidth: 240,             // plugin width
			iHeight: 160             // plugin height
		};
		var oLiveView = {
			iProtocol: 1,            // protocol 1：http, 2:https
			szIP: "192.168.2.5",    // protocol ip
			szPort: "80",            // protocol port
			szUsername: "admin",     // device username
			szPassword: "12345asd", // device password
			iStreamType: 1,          // stream 1：main stream  2：sub-stream  3：third stream  4：transcode stream
			iChannelID: 1,           // channel no
			bZeroChannel: false      // zero channel
			};
		// 关闭浏览器
		$(window).unload(function () {
			WebVideoCtrl.I_Stop();
		});

        var vm = avalon.define({
        	$id : "view",
        	weigh_cache:[],
        	insert:false,
        	truckAdd:false,
        	weigh:0,
        	weigh_class:'weigh-red',
        	stable:false,
        	is_reset:false,
        	houseId:0,
        	houseName:'',
        	user_info:{},
        	user_list:[],
        	user_power:[],
        	weigh_list:[],
        	weigh_menu:{display:false,x:0,y:0,id:0,select:0,el:{},item:
        		[
        			{text:'打印磅单',names:'printBill',value:1,power:false,class:'unenable'},
        			{text:'编辑磅单',names:'editBill',value:2,power:false,class:'unenable'},
        			{text:'删除磅单',names:'delBill',value:3,power:false,class:'unenable'},
        			{text:'删除毛重',names:'delFull',value:4,power:false,class:'unenable'},
        			{text:'删除皮重',names:'delEmpty',value:5,power:false,class:'unenable'},
        			{text:'皮毛交换',names:'changeWeigh',value:6,power:false,class:'unenable'},
        		]
        	},
        	weigh_search:{date:new Date().Format('yyyy-MM-dd'),operator:''},
        	truck_code_left:'',
        	menu_label:lab,
        	menu_sub:{scale:'full',system:'',report:'',function:''},
        	truck_code_list:[],
        	truck_type_list:[],
        	excavator_list:[],
        	customer_list:[],
        	house_list:[],
        	truck_list:[],
        	config_list:[],
        	route_list:[],
        	position_list:[],
        	position_select:[],
        	position_edit_select:[],
        	customer_receive_list:[],
        	goods_list:[],
        	config:{weighModel:0,codeType:0,codeLen:3,codePagearea:'',codePrintarea:''},
        	weightype:0,
        	codetype:1,
        	codePagearea:[2200,930],
        	codePrintarea:[],
        	display_main:true,
        	weigh_display_str:'weigh',
        	item:{billId:0,billCode:'',billDate:'',truckCode:'',emptyWeigh:0.00,fullWeigh:0.00,weigh:0.00,emptyTime:'',fullTime:'',emptyOperator:'',fullOperator:'',driver:'',excavator:'',goodsName:'',receiveUnit:'',sendUnit:'',canprint:false,truckType:'',position:'',mem:'',printCount:0,route:'',picUrl:'',emptyTimeDesc:'',fullTimeDesc:''},
        	button_disable:{enter:false,save:true,print:true,goon:false},
        	item_disable:{billDate:true,billCode:true,emptyWeigh:true,fullWeigh:true,weigh:true,excavator:true,goodsName:true,truckType:true,driver:true,receiveUnit:true,sendUnit:true,mem:true,position:true,route:true},
        	pre_item_disable:{},
        	only_current:true,
        	truckId:-1,
        	weigh_edit_display:false,
        	weigh_edit:{},
        	countInput:{sendUnit:'',receiveUnit:'',goodsName:''},
        	countItem:{emptyCounts:0,fullCounts:0,weighCounts:0,weighSum:0.00},
        	login_box_display:false,/*是否显示切换用户界面*/
        	user_login:{userName:'',userPwd:'',error:false,msg:''},
        	preWeigh:{error:false,msg:''},
        	preReEdit:{error:false,msg:''},
        	lock_box_display:false,/*是否显示屏幕锁定界面*/
        	report_model:'normalReport',/*报表模式*/
        	normal_report_list:[],
        	count_report_list:[],
        	normal_search:{billDate:new Date().Format('yyyy-MM-dd'),goodsName:'',sendUnit:'',receiveUnit:'',fullOperator:'',houseId:'',timeArea:0,billDateStart:new Date().Format('yyyy-MM-dd h:m'),billDateEnd:new Date().Format('yyyy-MM-dd h:m')},
        	count_search:{},
        	count_reprort_item:{},
        	normal_report_sum:'',/*显示普通报表总吨数*/
        	normal_report_cs:'',/*显示普通报表总车数*/
        	system_display:'user',/*系统维护菜单显示字符串*/
        	system_dis:{user:'list',truck:'list',customer:'list',goods:'list',excavator:'list',house:'list',truck_type:'list',config:'list'},/*系统管理中内部显示字符串*/
        	user_edit:{userPwd:'',oldPwd:'',checkPwd:''},/*记录用户编辑时的内容*/
        	user_add:{},
        	user_p:{editBill:false, delBill:false, delEmpty:false, delFull:false, printBill:false, changeWeigh:false,changeModel:false,searchCount:false,sql:false},/*记录编辑用户权限*/
        	user_dis:'list',
        	truck_dis:'list',/*记录车辆显示模式*/
        	truck_edit:{},/*记录车两编辑信息*/
        	truck_add:{truckCode:'',driver:'',truckOwner:'',truckType:''},
        	customer_dis:'list',
        	goods_dis:'list',
        	excavator_dis:'list',
        	house_dis:'list',
        	truck_type_dis:'list',
        	config_dis:'list',
        	printer:{},
        	change_list:[],
        	change_dis:'none',
        	change_all:false,
        	change_str:'',
        	picUrl:'',
        	list_display_str:'',
        	list_display:false,
        	load:function(){
        		$.post(logic_urls.index,{},
        			function(data,textStatus){
        				var json = TX.toJson(data);
        				console.log(json.data);
        				var t = Date.parse(new Date()) / 1000;
        				if(Math.abs(t - json.time) >= 30){
        					var tt = new Date(parseInt(json.time) * 1000).toLocaleString();
        					alert('当前系统与服务器时间不同步,服务器时间为:' + tt + ".请手动修改系统时间",{icon:3,skin: 'layer-ext-moon'});
        					vm.display_main = false;
        					return;
        				}
        				for(var k in json.data){
        					vm[k] = json.data[k];
        				}
        				vm.getCodeLen();
        				for(var i=0;i<vm.config.cacheLen;i++){
        					vm.weigh_cache[i] = 0;
        				}

        				if(vm.config.codePagearea){
        					var tmp = vm.config.codePagearea.split(',');
        					if(tmp.length >= 2){
        						vm.codePagearea = tmp;
        					}
        				}
        				if(vm.config.codePrintarea){
        					var tmp = vm.config.codePrintarea.split(',');
        					if(tmp.length >= 2){
        						vm.codePrintarea = tmp;
        					}
        				}
        				vm.user_power = vm.user_info.power.split(',');
        				/*for(var i=0;i<vm.weigh_menu.item.length;i++){
        					for(var s=0;s<vm.user_power.length;s++){
        						if(vm.weigh_menu.item[i]['names'] == vm.user_power[s]){
        							vm.weigh_menu.item[i]['power'] = true;
        							vm.weigh_menu.item[i]['class'] = 'enable';
        							break;
        						}
        					}
        				}*/
        				vm.setWeighMenuPower();
        				portInit(vm.config);
        				vm.getCountList();
        				if(vm.config.video == 1 && isallow == true){        					
        					vm.setVideoDefaul();
        					canVideo = false;
        					vm.initVideo(); 
        					vm.setVideoConfig();
        				}
        				avalon.scan();
        			}
        		);
        	},
        	initVideo:function(){
        		// 初始化插件参数及插入插件
		    	WebVideoCtrl.I_InitPlugin(oPlugin.iWidth, oPlugin.iHeight, {
					bWndFull: true,//是否支持单窗口双击全屏，默认支持 true:支持 false:不支持
					iWndowType: 1,
					cbInitPluginComplete: function () {
						WebVideoCtrl.I_InsertOBJECTPlugin("divPlugin");
						// 检查插件是否最新
						if (-1 == WebVideoCtrl.I_CheckPluginVersion()) {
							layer.alert("检测到新的插件版本，双击开发包目录里的WebComponentsKit.exe升级！",{icon:3,skin: 'layer-ext-moon'});
							canVideo = false;
							return;
						}
						// 登录设备
						WebVideoCtrl.I_Login(oLiveView.szIP, oLiveView.iProtocol, oLiveView.szPort, oLiveView.szUsername, oLiveView.szPassword, {
								success: function (xmlDoc) {
								// 开始预览
								canVideo = true;
								var szDeviceIdentify = oLiveView.szIP + "_" + oLiveView.szPort;
								setTimeout(function () {
									WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
										iStreamType: oLiveView.iStreamType,
										iChannelID: oLiveView.iChannelID,
										bZeroChannel: oLiveView.bZeroChannel
									});
								}, 1000);
							},
							error: function (status, xmlDoc) {
								layer.alert(" 登录摄像头失败！");
								canVideo = false;
							}
						});
					}
				});
        	},
        	setVideoDefaul:function(){
				oLiveView = {
					iProtocol: 1,            // protocol 1：http, 2:https
					szIP:vm.config.cameraIp,    // protocol ip
					szPort:vm.config.cameraPort,            // protocol port
					szUsername:vm.config.cameraUser,     // device username
					szPassword:vm.config.cameraPwd, // device password
					iStreamType: 1,          // stream 1：main stream  2：sub-stream  3：third stream  4：transcode stream
					iChannelID: 1,           // channel no
					bZeroChannel: false      // zero channel
				};
        	},
        	setVideoConfig:function(){
				
				var arrXml = [];
    
				arrXml.push("<LocalConfigInfo>");
				arrXml.push("<CapturePath>" + vm.config.picUrl + "</CapturePath>");
				arrXml.push("</LocalConfigInfo>");
				var iRet1 = WebVideoCtrl.I_SetLocalCfg(arrXml.join(""));

				if (0 == iRet1) {
					
				} else {
					canVideo = false;
					TX.msg("本地配置设置失败！请联系管理员",{time:5000,icon:3,skin: 'layer-ext-moon'});
				}

        	},
        	capturePic:function(szPicName){
        		var oWndInfo = WebVideoCtrl.I_GetWindowStatus();
				if (oWndInfo != null) {
					var xmlDoc = WebVideoCtrl.I_GetLocalCfg();
					var szCaptureFileFormat = "0";
					if (xmlDoc != null) {
						szCaptureFileFormat = $(xmlDoc).find("CaptureFileFormat").eq(0).text();
					}
					/*console.log(oWndInfo.szDeviceIdentify);
					return;
					var szChannelID = $("#channels").val();
					var szPicName = new Date().getTime();*/
            
					szPicName += ("0" === szCaptureFileFormat) ? ".jpg": ".bmp";
					var iRet = WebVideoCtrl.I_CapturePic(szPicName, {
						bDateDir: false  //是否生成日期文件
					});
            		if (0 == iRet) {
            			vm.picUrl = szPicName;
            			vm.is_reset = false;
            			//TX.msg('抓图成功！',{time:3000});
            			$.post('http://uploadimg.com:8089',{filename:vm.config.picUrl + vm.picUrl},
            				function(data){
            					var json = TX.toJson(data);
								console.log(json);
								if(json.status != 1){
									TX.msg('上传图片失败，代码为' + json.msg,{time:3000,icon:3,skin: 'layer-ext-moon'})
								}
            				}
            			);
            			vm.setButtonDisable('enter');
						vm.setItemDisable(0);
					} else {
						layer.alert('抓图失败！',{time:3000,icon:3,skin: 'layer-ext-moon'});
						vm.picUrl = '';
					}
				}
        	},
        	changeMenu:function(m){
        		if(m == 'system'){
        			/*if(vm.user_info.isManager < 1){
        				TX.msg('您没有权限访问此页',{time:3000});
        				return;
        			}*/
        			window.location.href = '/home/index/system';
        			return;
        		}
        		if(m == 'function'){
        			for(var i=0;i<vm.user_power.length;i++){
        				if(vm.user_power[i] == 'accounting'){
        					window.location.href = '/home/index/accounting';
        					break;
        					return;
        				}
        			}
        			TX.msg('您没有权限访问此页',{time:3000});
        			return;
        		}        		
        		if(m == 'report'){
        			//window.location.href = '/home/index/report';
        			window.open('/home/index/report');
        			return;
        		}
        		vm.menu_label = m;
        	},
        	changeScaleType(sub_key,sub_type){
        		vm.menu_sub.scale = sub_key;
        		vm.weightype = sub_type;
        	},
        	setItemDisable:function(md){
        		if(md == 1){
        			vm.item_disable = {billDate:true,billCode:true,emptyWeigh:true,fullWeigh:true,weigh:true,excavator:false,goodsName:false,truckType:false,driver:false,receiveUnit:false,sendUnit:false,mem:false,position:false,route:false};
        		}else{
        			vm.item_disable = {billDate:true,billCode:true,emptyWeigh:true,fullWeigh:true,weigh:true,excavator:true,goodsName:true,truckType:true,driver:true,receiveUnit:true,sendUnit:true,mem:true,position:true,route:true};
        		}
        	},
        	setButtonDisable:function(str){
        		if(str == 'enter'){
        			vm.button_disable = {enter:true,save:false,print:true,goon:false};
        		}else if(str == 'save'){
        			vm.button_disable = {enter:true,save:true,print:vm.item.canprint,goon:false};
        		}else if(str == 'print'){
        			vm.button_disable = {enter:true,save:true,print:true,goon:false};
        		}else if(str == 'goon'){
        			vm.button_disable = {enter:false,save:true,print:true,goon:false};
        		}
        	},
        	/*锁定过磅数据及生成磅单编号*/
        	lockData:function(){
        		console.log(canVideo);
        		if(!vm.is_reset){
        			layer.alert('仪表未清零',{time:3000,icon:3,skin: 'layer-ext-moon'});
        			return;
        		}
        		if(!vm.stable){
        			layer.alert('仪表读数未稳定，请稍后再试',{time:3000,icon:3,skin: 'layer-ext-moon'});
        			return;
        		}
        		vm.item.billDate = new Date().Format('yyyy-MM-dd');
        		if(vm.config.isDebug == 1){
        			vm.weigh = vm.item.mem;
        		}
        		if(vm.config.weighModel > 0){
        			/*车一回皮*/
        			if(vm.weightype == 0){
        				vm.item.fullOperator = vm.user_info['userName'];
        				vm.item.fullTime = Date.parse(new Date());
        				vm.item.fullTimeDesc = (new Date()).getHours() + ':' + (new Date()).getMinutes() + ':' + (new Date()).getSeconds();
        				vm.item.fullWeigh = vm.weigh;
        			}else{
        				vm.item.emptyOperator = vm.user_info['userName'];
        				vm.item.emptyTime = Date.parse(new Date());
        				vm.item.emptyTimeDesc = (new Date()).getHours() + ':' + (new Date()).getMinutes() + ':' + (new Date()).getSeconds();
        				vm.item.emptyWeigh = vm.weigh;
        			}
        		}else{
        			/*预存车皮*/
        			if(vm.weightype == 0){
        				vm.item.fullOperator = vm.user_info['userName'];
        				vm.item.fullTime = Date.parse(new Date());
        				vm.item.fullTimeDesc = (new Date()).getHours() + ':' + (new Date()).getMinutes() + ':' + (new Date()).getSeconds();
        				vm.item.fullWeigh = vm.weigh;
        				vm.item.emptyOperator = vm.user_info['userName'];
        				vm.item.emptyTime = Date.parse(new Date());
        				vm.item.emptyTimeDesc = (new Date()).getHours() + ':' + (new Date()).getMinutes() + ':' + (new Date()).getSeconds();
        			}else{
        				vm.item.emptyOperator = vm.user_info['userName'];
        				vm.item.emptyTime = Date.parse(new Date());
        				vm.item.emptyTimeDesc = (new Date()).getHours() + ':' + (new Date()).getMinutes() + ':' + (new Date()).getSeconds();
        				vm.item.emptyWeigh = vm.weigh;
        			}
        		}
        		vm.preWeigh.error = false;
        		vm.preCheckWeigh(0);
        		if(vm.preWeigh.error){
        			layer.alert(vm.preWeigh.msg,{icon:3,skin:'layer-ext-moon'});
        			return;
        		}
        		if(vm.item.emptyWeigh > 0 && vm.item.fullWeigh > 0){
        			vm.item.weigh = Math.abs(vm.item.fullWeigh - vm.item.emptyWeigh);
        		}else{
        			vm.item.weigh = 0;
        		}
        		if((vm.item.billCode.length == 0) && (vm.config.weighModel > 0 || (vm.config.weighModel == 0 && vm.weightype == 0))){
        			TX.msg('正在读取数据...',{time:30000});
        			console.log(vm.item);
    				$.post(logic_urls.codeNumber,{codeLeft:vm.config.codeLeft},
    					function(data){
    						var json = TX.toJson(data);
    						console.log(json);
    						if(json.status == 1){
    							vm.item.billCode = json.data;
    							layer.closeAll();
    							if(vm.config.video == 1 && canVideo == true && vm.weightype == 0){
    								vm.capturePic(vm.item.billCode);
    							}else{
    								vm.setButtonDisable('enter');
    								vm.setItemDisable(0);
    							}
    							
    							avalon.scan();
    						}else{
    							TX.msg(json.msg,{time:5000});
    							vm.setButtonDisable('goon');
    							vm.setItemDisable(0);
    						}
    						
    					}
    				);
        		}else{
        			if(vm.config.video == 1 && canVideo == true && vm.weightype == 0){
						vm.capturePic(vm.item.billCode);
					}else{
						vm.setButtonDisable('enter');
						vm.setItemDisable(0);
					}
        			
        		}
        	},
        	/*保存过磅数据*/
        	saveData:function(){
        		vm.preWeigh.error = false;
        		vm.preCheckWeigh(1);        		
        		if(vm.preWeigh.error){
        			layer.alert(vm.preWeigh.msg,{icon:3,skin:'layer-ext-moon'});
        			return;
        		}
        		if(vm.config.weighModel == 0 && vm.weightype == 1){
        			var kd = {
        				weighDate:vm.item.billDate,
        				truckCode:vm.item.truckCode,
        				driver:vm.item.driver,
        				emptyWeigh:vm.item.emptyWeigh,
        				emptyOperator:vm.item.emptyOperator
        			}
        			console.log(kd);
        			TX.msg('正在保存数据...',{time:30000});
        			$.post(logic_urls.saveTruckEmpty,kd,
        				function(data){
        					console.log(data);
        					var json = TX.toJson(data);
        					if(json.status == 1){
        						layer.closeAll();
        						TX.msg('预存车皮成功',{time:3000});
        					}else{
        						TX.msg('预存车皮失败,' + json.msg,{time:3000});
        					}
        				}
        			);
        			vm.setButtonDisable('print');
	        		vm.setItemDisable(0);
        		}else{
        			var xd = {billCode:vm.item.billCode,insert:vm.insert};
	        		console.log(xd);
	        		TX.msg('正在保存数据...',{time:30000});
	        		$.post(logic_urls.checkBillCode,xd,
	        			function(data){
	        				var json = TX.toJson(data);
							console.log(json);
							if(json.status == 1){
								var pd = {
									billId:vm.item.billId,
									billCode:vm.item.billCode,
									billDate:vm.item.billDate,
									truckCode:vm.item.truckCode,
									emptyWeigh:vm.item.emptyWeigh,
									fullWeigh:vm.item.fullWeigh,
									weigh:vm.item.weigh,
									emptyTime:vm.item.emptyTime,
									fullTime:vm.item.fullTime,
									emptyOperator:vm.item.emptyOperator,
									fullOperator:vm.item.fullOperator,
									driver:vm.item.driver,
									excavator:vm.item.excavator,
									goodsName:vm.item.goodsName,
									receiveUnit:vm.item.receiveUnit,
									sendUnit:vm.item.sendUnit,
									truckType:vm.item.truckType,
									driver:vm.item.driver,
									mem:vm.item.mem,
									position:vm.item.position,
									houseId:vm.houseId,
									weighModel:vm.config.weighModel,
									weightype:vm.weightype,
									insert:vm.insert,
									picUrl:vm.picUrl
								};
								vm.picUrl = '';
								console.log(pd);
								$.post(logic_urls.saveBill,pd,
									function(tdata){
										var jsoner = TX.toJson(tdata);
										console.log(jsoner);
										if(jsoner.status == 1){
											vm.item.canprint = !jsoner.canprint;
											/*if(vm.item.billId <= 0){
												vm.item.billId = jsoner.billId;
											}*/
											for(var k in jsoner.data){
												vm.item[k] = jsoner.data[k];
											}
											if(vm.item.emptyTime){
												vm.item.emptyTimeDesc = vm.item.emptyTime;
											}
											if(vm.item.fullTime){
												vm.item.fullTimeDesc = vm.item.fullTime;
											}
											vm.setButtonDisable('save');
	        								vm.setItemDisable(0);
	        								vm.getCountList();
											/*if(vm.item.canprint){
												vm.setButtonDisable('print');
	        									vm.setItemDisable(0);
	        									console.log('canprint');
											}else{
												vm.setButtonDisable('save');
												vm.setItemDisable(0);
												console.log('cannotprint');
											}*/
										}else{
											TX.msg(jsoner.msg,{time:5000});
											vm.setButtonDisable('goon');
										}
									}
								);
								layer.closeAll();
							}else{
								TX.msg(json.msg,{time:5000});
								vm.setButtonDisable('goon');
							}
	        			}
	        		);
        		}
        	},
        	/*打印过磅单*/
        	printData:function(){
        		orderPrint(vm.config,vm.item,vm.weightype);
        		vm.setButtonDisable('print');
        		vm.setItemDisable(0);
        	},
        	/*清空己过磅数据重置控件状态*/
        	goon:function(){
        		vm.setButtonDisable('goon');
        		vm.item.truckCode = '';
        		vm.item.position = '';
        		vm.item.route = '';
        		vm.picUrl = '';
				vm.item.picUrl = '';
        		vm.setItemDisable(0);
        		vm.is_reset = false;
        	},
        	setPreItemDisable:function(){

        	},
        	/*切换主菜单*/
        	changeConfig:function(){
        		vm.changeScaleType('full',0);
        	},
        	/*切换过磅类型*/
        	changeCodeType:function(){
        		vm.getCodeLen();
        		avalon.scan();
        	},
        	/*查询过磅车辆,自动填充过磅数据*/
        	searchTruck:function(){
        		this.value = this.value.toUpperCase();
        		if(vm.item.truckCode.length == vm.config.codeLen){
        			var vd = {
        				truckCode:vm.item.truckCode,
        				weighmodel:vm.config.weighModel,
        				weightype:vm.weightype,
        				houseId:vm.houseId,
        				weighInterval:vm.config.weighInterval,
        				timeAreareport:vm.config.timeAreareport
        			};
        			console.log(vd);
        			if(vm.config.codeType == 1){
        				vd.truckCode = vm.truck_code_left + vm.item.truckCode;
        			}
        			TX.msg('正在读取数据...',{time:5000});
        			$.post(logic_urls.truckByCode,vd,
        				function(data,textStatus){
        					var json = TX.toJson(data);
        					console.log(json);
        					if(json.status == 1){
        						for(var k in json.data){
        							vm.item[k] = json.data[k];
        						}
        						if(json.data.truckId){
        							vm.truckId = json.data.truckId;
        						}
        						vm.insert = json.insert;
                    			vm.truckAdd = json.truckAdd;
        						vm.setItemDisable(1);
        						layer.closeAll();
        					}else if(json.status == -1){
        						console.log(json);
        						TX.msg(json.msg,{icon:1,time:2000});
        						for(var k in json.data){
        							if(vm.item[k]){
        								vm.item[k] = json.data[k];
        							}
        						}
        						if(json.data.truckId){
        							vm.truckId = json.data.truckId;
        						}
        						vm.setItemDisable(0);
        					}else if(json.status == -2){
        						console.log(json);
        						TX.msg(json.msg,{icon:1,time:2000});
        						for(var k in json.data){
        							if(vm.item[k]){
        								vm.item[k] = json.data[k];
        							}
        						}
        						if(json.data.truckId){
        							vm.truckId = json.data.truckId;
        						}
        						vm.setItemDisable(0);
        						vm.item['truckCode'] = '';
        					}
        					vm.picUrl = '';
        					vm.item.picUrl = '';
        					vm.item.position = '';
        					vm.item.route = '';
        					vm.setButtonDisable('goon');
        					console.log(vm.item);
        					avalon.scan();
        				}
        			);
        		}else{
        			vm.setButtonDisable('goon');
        			vm.setItemDisable(0);
        		}
        	},
        	/*根据车牌类型获取车牌号码长度*/
        	getCodeLen:function(){
        		if(vm.config.codeType == 1){
        			vm.config.codeLen = vm.config.normalLen - 1;
        		}else{
        			vm.config.codeLen = vm.config.tempLen;
        		}
        	},
        	/*记录磅头读数并缓存磅头读数*/
        	dataProcess:function(weigh){
        		var weighvalue = getCode(weigh);
        		vm.weigh = weighvalue;
        		vm.cacheWeigh(weighvalue);
        	},
        	/*缓存地磅读数*/
        	cacheWeigh:function(weigh){
        		vm.weigh_cache.splice(0,0,weigh);
        		if(vm.weigh_cache.length > vm.config.cacheLen){
        			vm.weigh_cache.splice(vm.config.cacheLen,vm.weigh_cache.length - vm.config.cacheLen);
        		}
        		vm.isStable();
        		//console.log(vm.weigh_cache);
        	},
        	/*判断磅头读数是否稳定,切换颜色*/
        	isStable:function(){
        		var sum = 0;
        		
        		if(vm.weigh == 0){
        			vm.stable = false;
        			vm.is_reset = true;
        			vm.weigh_class = 'weigh-red';
        		}else{
        			for(var i=0;i<vm.config.cacheLen;i++){
	        			sum += parseInt(vm.weigh_cache[i]); 
	        		}
        			
        			if((sum / vm.config.cacheLen) == vm.weigh){
        				vm.stable = true;
        				vm.weigh_class = 'weigh-green';
        				
        			}else{
        				vm.stable = false;
        				vm.weigh_class = 'weigh-red';
        			}
        		}
        	},
        	/*获取当日净重*/
        	getWeighList:function(e,para){
        		vm.list_display_str = 'weigh_list';
        		vm.list_display = true;
        		$("#divPlugin").css('margin-left',"1000px");
        		if(!para){
        			para = {date:new Date().format('yyyy-MM-dd'),
        					operator:''};
        			console.log(para);
        		}
        		vm.weigh_list = [];
        		TX.msg('正在读取数据',{time:5000});
        		$.post(logic_urls.getWeighList,para,
        			function(data){
        				console.log(data);
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					layer.closeAll();
        					vm.weigh_list = json.data;
        					for(var i=0;i<vm.weigh_list.length;i++){
	        					if(i % 2 == 0){
	        						vm.weigh_list[i]['bg'] = 'bg-o';
	        					}else{
	        						vm.weigh_list[i]['bg'] = 'bg-e';
	        					}
	        				}
        					console.log(vm.weigh_list);        					
        					avalon.scan();
        				}else{
        					TX.msg(json.msg,{time:5000});
        				}
        			}
        		);
        	},
        	/*关闭当日净重*/
        	cancelWeighList:function(){
        		vm.list_display_str = '';
        		vm.list_display = false;
        		vm.weigh_list = [];
        		$("#divPlugin").css('margin-left','10px');
        		var szDeviceIdentify = oLiveView.szIP + "_" + oLiveView.szPort;
				setTimeout(function () {
					WebVideoCtrl.I_StartRealPlay(szDeviceIdentify, {
						iStreamType: oLiveView.iStreamType,
						iChannelID: oLiveView.iChannelID,
						bZeroChannel: oLiveView.bZeroChannel
					});
				}, 1000);
        		vm.setWeighMenuPower();
        	},
        	/*获取当日己过皮得车辆列表*/
        	getEmptyList:function(){
        		$("#divPlugin").css('margin-left',"1000px");
        		vm.list_display_str = 'empty_list';
        		vm.list_display = true;
        		vm.weigh_list = [];
        		TX.msg('正在读取数据',{time:5000});
        		$.post(logic_urls.getUnableBills,{type:1,sd:0},
        			function(data){
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					layer.closeAll();
        					vm.weigh_menu.item[0]['power'] = false;
        					vm.weigh_menu.item[0]['class'] = 'unenable';
        					vm.weigh_menu.item[3]['power'] = false;
        					vm.weigh_menu.item[3]['class'] = 'unenable';
        					vm.weigh_menu.item[5]['power'] = false;
        					vm.weigh_menu.item[5]['class'] = 'unenable';
        					vm.weigh_list = json.data;
        					for(var i=0;i<vm.weigh_list.length;i++){
	        					if(i % 2 == 0){
	        						vm.weigh_list[i]['bg'] = 'bg-o';
	        					}else{
	        						vm.weigh_list[i]['bg'] = 'bg-e';
	        					}
	        				}
        				}else{
        					Tx.msg(json.msg,{time:500000});
        				}
        			}
        		);
        	},
        	/*获取当日己过毛重车辆列表*/
        	getFullList:function(){
        		vm.list_display_str = 'full_list';
        		vm.list_display = true;
        		$("#divPlugin").css('margin-left',"1000px");
        		vm.weigh_list = [];
        		TX.msg('正在读取数据',{time:5000});
        		$.post(logic_urls.getUnableBills,{type:0,sd:0},
        			function(data){
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					layer.closeAll();
        					vm.weigh_menu.item[0]['power'] = false;
        					vm.weigh_menu.item[0]['class'] = 'unenable';
        					vm.weigh_menu.item[4]['power'] = false;
        					vm.weigh_menu.item[4]['class'] = 'unenable';
        					vm.weigh_menu.item[5]['power'] = false;
        					vm.weigh_menu.item[5]['class'] = 'unenable';
        					vm.weigh_list = json.data;
        					for(var i=0;i<vm.weigh_list.length;i++){
	        					if(i % 2 == 0){
	        						vm.weigh_list[i]['bg'] = 'bg-o';
	        					}else{
	        						vm.weigh_list[i]['bg'] = 'bg-e';
	        					}
	        				}
        				}else{
        					Tx.msg(json.msg,{time:500000});
        				}
        			}
        		);
        	},
        	/*根据过磅类型获取待磅车辆列表*/
        	getWaiteList:function(){
        		vm.list_display_str = 'toWeigh_list';
        		vm.list_display = true;
        		$("#divPlugin").css('margin-left',"1000px");
        		vm.weigh_list = [];
        		TX.msg('正在读取数据',{time:5000});
        		$.post(logic_urls.getUnableBills,{type:vm.weightype,sd:0},
        			function(data){
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					layer.closeAll();
        					vm.weigh_menu.item[0]['power'] = false;
        					vm.weigh_menu.item[0]['class'] = 'unenable';
        					vm.weigh_menu.item[3]['power'] = false;
        					vm.weigh_menu.item[3]['class'] = 'unenable';
        					vm.weigh_menu.item[4]['power'] = false;
        					vm.weigh_menu.item[4]['class'] = 'unenable';
        					vm.weigh_menu.item[5]['power'] = false;
        					vm.weigh_menu.item[5]['class'] = 'unenable';
        					vm.weigh_list = json.data;
        					for(var i=0;i<vm.weigh_list.length;i++){
	        					if(i % 2 == 0){
	        						vm.weigh_list[i]['bg'] = 'bg-o';
	        					}else{
	        						vm.weigh_list[i]['bg'] = 'bg-e';
	        					}
	        				}
        				}else{
        					Tx.msg(json.msg,{time:500000});
        				}
        			}
        		);
        	},
        	/*鼠标右键菜单*/
        	getMouseButton:function(e,el){
        		console.log('asdf');
        		vm.weigh_menu.display = false;
        		if(e.which == 3){
        			var xa = $(document).scrollTop();
        			if(e.clientX + 200 > w){
        				vm.weigh_menu.x = w - 200;
        			}else{
        				vm.weigh_menu.x = e.clientX - 10;
        			}
        			if(e.clientY + 250 > h){
        				vm.weigh_menu.y = h - 250 + xa;
        				console.log(e.clientY);
        			}else{
        				vm.weigh_menu.y = e.clientY - 10 + xa;
        				console.log(e.clientY);
        			}
        			console.log(vm.weigh_menu.y);
        			$("#rightMenu").css('top',vm.weigh_menu.y + 'px').css('left',vm.weigh_menu.x + 'px');
        			vm.weigh_menu.display = true;
        			vm.weigh_menu.el = el;
        		}
        	},
        	/*隐藏右键菜单*/
        	hideWeighMenu:function(){
        		vm.weigh_menu.display = false;
        		console.log('8');
        	},
        	menuSelect:function(e,idx,id,power){
        		if(false == power){return;}
        		console.log(id);
        		switch(id){
        			case 1:
        				var item = {};
        				for(var k in vm.weigh_menu.el){
        					item[k] = vm.weigh_menu.el[k];
        				}
        				/*var td = new Date(parseInt(item['emptyTime']) * 1000);
        				item['emptyTime'] = td.getHours() + ':' + td.getMinutes() + ':' + td.getSeconds();*/
        				item['emptyTime'] = item['emptyTimeDesc'];
        				item['fullTime'] = item['fullTimeDesc'];
        				item['billDate'] = item['billDateDesc'];
        				orderPrint(vm.config,item,vm.weightype);
        				break;
        			case 2:
        				vm.toEditBill(vm.weigh_menu.el,idx);
        				break;
        			case 3:
        				vm.toDelBill(vm.weigh_menu.el,1,idx);
        				break;
        			case 4:
        				vm.toDelBill(vm.weigh_menu.el,2,idx);
        				break;
        			case 5:
        				vm.toDelBill(vm.weigh_menu.el,3,idx);
        				break;
        			case 6:
        				vm.changeWeigh(vm.weigh_menu.el,4,idx);
        				break;
        			default:
        				break;
        		}
        		vm.weigh_menu.display = false;

        	},
        	/*磅单查询*/
        	billSearch:function(e){
        		var td = {
        			date:vm.weigh_search.date,
        			operator:vm.weigh_search.operator
        		};
        		vm.getWeighList(e,td);
        	},
        	toEditBill:function(el){
        		vm.weigh_edit = el;
        		vm.weigh_edit_display = true;
        	},
        	editBillSave:function(){
        		var sd = {
						billId:vm.weigh_edit.billId,
						excavator:vm.weigh_edit.excavator,
						goodsName:vm.weigh_edit.goodsName,
						receiveUnit:vm.weigh_edit.receiveUnit,
						sendUnit:vm.weigh_edit.sendUnit,
						truckType:vm.weigh_edit.truckType,
						driver:vm.weigh_edit.driver,
						mem:vm.weigh_edit.mem,
						position:vm.weigh_edit.position,
						route:vm.weigh_edit.route
					};
        		console.log(sd);
        		
        		TX.msg('正在读取数据',{time:5000});
        		$.post(logic_urls.editBill,sd,
        			function(data){
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					layer.closeAll();
        					for(var i=0;i<vm.weigh_list.length;i++){
        						if(vm.weigh_list[i]['billId'] == json.data.billId){
        							for(var k in json.data){
        								vm.weigh_list[i][k] = json.data[k];
        							}
        							break;
        						}
        						vm.weigh_edit_display = false;
        					}
        				}else{
        					TX.msg(json.msg,{time:5000});
        				}
        			}
        		);
        	},
        	editBillCancel:function(){
        		vm.weigh_edit_display = false;
        		console.log(vm.weigh_edit_display);
        		avalon.scan();
        	},
        	toDelBill:function(el,mid,idx){
        		if(vm.user_info['userName'] != el.fullOperator){
        			if(vm.user_info['userName'] != el.emptyOperator){
        				if(vm.user_info['isManager'] != 1){
        					TX.msg('司磅员不符,您没有修改权限',{time:5000});
        					return false;
        				}
        			}
        		}
        		if(el.locked == 1){
        			TX.msg('此磅单己被管理员锁定,无法被修改,请联系核算员或管理员进行解锁后再试',{time:5000});
        			return false;
        		}
        		var sd = {
        			billId:el.billId,
        			emptyWeigh:el.emptyWeigh,
        			fullWeigh:el.fullWeigh,
        			weigh:el.weigh,
        			md:mid
        		};
        		TX.msg('正在保存数据',{time:5000});
        		$.post(logic_urls.delBill,sd,
        			function(data){
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					console.log(json);
        					layer.closeAll();
        					for(var i=0;i<vm.weigh_list.length;i++){
        						if(vm.weigh_list[i].billId == json.data.billId){
        							vm.weigh_list.splice(i,1);
        						}
        						break;
        					}
        					vm.weigh_edit_display = false;
        				}else{
        					TX.msg(json.msg,{time:5000});
        				}
        			}
        		);
        	},
        	changeWeigh:function(el,mid,idx){
        		var sd = {
        			billId:el.billId,
        			emptyWeigh:el.emptyWeigh,
        			fullWeigh:el.fullWeigh,
        			weigh:el.weigh,
        			md:mid
        		};
        		console.log(sd);
        		TX.msg('正在保存数据',{time:5000});
        		$.post(logic_urls.delBill,sd,
        			function(data){
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					console.log(json);
        					layer.closeAll();
        					for(var i=0;i<vm.weigh_list.length;i++){
        						if(vm.weigh_list[i].billId == json.data.billId){
        							vm.weigh_list[i]['emptyWeigh'] = json.data.fullWeigh;
        							vm.weigh_list[i]['fullWeigh'] = json.data.emptyWeigh;
        							break;
        						}        						
        					}
        					vm.weigh_edit_display = false;
        				}else{
        					TX.msg(json.msg,{time:5000});
        				}
        			}
        		);
        	},
        	/*设置磅单菜单权限*/
        	setWeighMenuPower:function(){
        		for(var i=0;i<vm.weigh_menu.item.length;i++){
					for(var s=0;s<vm.user_power.length;s++){
						if(vm.weigh_menu.item[i]['names'] == vm.user_power[s]){
							vm.weigh_menu.item[i]['power'] = true;
							vm.weigh_menu.item[i]['class'] = 'enable';
							break;
						}else{
							vm.weigh_menu.item[i]['power'] = false;
							vm.weigh_menu.item[i]['class'] = 'unenable';
						}
					}
				}
        	},
        	/*读取过磅统计信息*/
        	getCountList:function(){
        		var cd = {
        			sendUnit:vm.countInput.sendUnit,
        			receiveUnit:vm.countInput.receiveUnit,
        			goodsName:vm.countInput.goodsName,
        			mine:vm.only_current == true?1:0
        		};
        		//TX.msg('正在读取过磅数据',{time:5000});
        		$.post(logic_urls.getCountWeigh,cd,
        			function(data){
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					//layer.closeAll();
        					vm.countItem = json.data;
        					avalon.scan();
        				}else{
        					TX.msg('获取过磅统计信息失败',{time:5000});
        				}
        			}
        		)
        	},
        	/*用户登录*/
        	signin:function(e,md){
        		var pd = {
        			houseId:vm.houseId,
        			userName:vm.user_login.userName,
        			userPwd:$.md5(vm.user_login.userPwd + $.md5(vm.user_login.userPwd))
        		};
        		vm.preCheckUser();
        		if(vm.user_login.error){
        			TX.msg(vm.user_login.msg,{icon:2});
        			return;
        		}
        		TX.msg('正在读取数据');
        		$.post(logic_urls.login,pd,
        			function(data){
        				var json = TX.toJson(data);
        				console.log(json);
        				if(json.status == 1){
        					layer.closeAll();
        					if(md){
        						vm.user_login.userName = '';
        						vm.lock_box_display = false;
        					}else{        						
        						json.data.is_sign_in = true;
	        					logic_user.onSignin(json.data);
	        					logic_house.houseId = json.config['houseId'];
	        					logic_house.save();
	        					vm.load();
	        					vm.login_box_display = false;
        					}
        					
        				}else{
        					TX.msg(json.msg,{icon:1,time:2000});
        				}
        			}
        		);
        	},
        	
        	preCheckWeigh:function(md){
        		vm.preWeigh.error = false;
        		vm.preWeigh.msg = '';
        		/*md=1为保存时的检查,为0时为确认时的检查*/
        		if(md == 0){
        			//确认检查
        			if(vm.config.weighModel == 0){
        				//预存车皮
        				if(vm.weightype == 0){
        					vm.preWeigh.msg = validator.checkText(vm.item.truckCode,1,20,'车牌号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.goodsName,1,30,'物资名称');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.driver,1,20,'司机姓名');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.truckType,1,20,'车辆型号');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.excavator,1,20,'钩机号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.sendUnit,1,50,'发货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.receiveUnit,1,50,'收货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkNumber(vm.item.emptyWeigh - 1,'皮重');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        				}else{
        					vm.preWeigh.msg = validator.checkText(vm.item.truckCode,1,20,'车牌号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        				}
        			}else{
        				//车车回皮
        				if(vm.weightype == 0){
							//毛重
							vm.preWeigh.msg = validator.checkText(vm.item.truckCode,1,20,'车牌号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.goodsName,1,30,'物资名称');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.driver,1,20,'司机姓名');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.truckType,1,20,'车辆型号');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.excavator,1,20,'钩机号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.sendUnit,1,50,'发货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.receiveUnit,1,50,'收货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkNumber(vm.item.fullWeigh - 1,'毛重');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					if(!vm.insert){
        						vm.preWeigh.msg = validator.checkNumber(vm.item.emptyWeigh - 1,'皮重');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
	        					vm.preWeigh.msg = validator.checkText(vm.item.billCode,1,30,'磅单编号');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
        					}
						}else{
							//皮重
							vm.preWeigh.msg = validator.checkText(vm.item.truckCode,1,20,'车牌号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.goodsName,1,30,'物资名称');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.driver,1,20,'司机姓名');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.truckType,1,20,'车辆型号');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.sendUnit,1,50,'发货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.receiveUnit,1,50,'收货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkNumber(vm.item.emptyWeigh - 1,'皮重');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					if(!vm.insert){
        						vm.preWeigh.msg = validator.checkNumber(vm.item.fullWeigh - 1,'毛重');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
	        					vm.preWeigh.msg = validator.checkText(vm.item.billCode,1,30,'磅单编号');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
        					}
						}
        			}
        		}else{
        			//预存车皮时
        			if(vm.config.weighModel == 0){
        				//毛重
        				if(vm.weightype == 0){
        					vm.preWeigh.msg = validator.checkText(vm.item.truckCode,1,20,'车牌号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.goodsName,1,20,'物资名称');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.driver,1,20,'司机姓名');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.truckType,1,20,'车辆型号');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.excavator,1,20,'钩机号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.sendUnit,1,20,'发货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.receiveUnit,1,20,'收货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkNumber(vm.item.fullWeigh - 1,'毛重');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkNumber(vm.item.emptyWeigh - 1,'皮重');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkNumber(vm.item.weigh - 1,'净重');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        				}else{
        					//皮重
        					vm.preWeigh.msg = validator.checkText(vm.item.truckCode,1,20,'车牌号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkNumber(vm.item.emptyWeigh - 1,'皮重');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        				}
        			}else{
						//车车回皮
						if(vm.weightype == 0){
							//毛重
							vm.preWeigh.msg = validator.checkText(vm.item.truckCode,1,20,'车牌号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.goodsName,1,20,'物资名称');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.driver,1,20,'司机姓名');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.truckType,1,20,'车辆型号');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.excavator,1,20,'钩机号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.sendUnit,1,20,'发货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.receiveUnit,1,20,'收货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkNumber(vm.item.fullWeigh - 1,'毛重');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					if(!vm.insert){
        						vm.preWeigh.msg = validator.checkNumber(vm.item.emptyWeigh - 1,'皮重');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
	        					vm.preWeigh.msg = validator.checkNumber(vm.item.weigh - 1,'净重');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
	        					vm.preWeigh.msg = validator.checkText(vm.item.billCode,1,30,'磅单编号');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
        					}
						}else{
							//皮重
							vm.preWeigh.msg = validator.checkText(vm.item.truckCode,1,20,'车牌号码');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.goodsName,1,20,'物资名称');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.driver,1,20,'司机姓名');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.truckType,1,20,'车辆型号');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.sendUnit,1,20,'发货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkText(vm.item.receiveUnit,1,20,'收货单位');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					vm.preWeigh.msg = validator.checkNumber(vm.item.emptyWeigh - 1,'皮重');
        					if(vm.preWeigh.msg != ''){
        						vm.preWeigh.error = true;
        						return;
        					}
        					if(!vm.insert){
        						vm.preWeigh.msg = validator.checkNumber(vm.item.fullWeigh - 1,'毛重');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
	        					vm.preWeigh.msg = validator.checkNumber(vm.item.weigh - 1,'净重');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
	        					vm.preWeigh.msg = validator.checkText(vm.item.billCode,1,30,'磅单编号');
	        					if(vm.preWeigh.msg != ''){
	        						vm.preWeigh.error = true;
	        						return;
	        					}
        					}
						}
        			}
        		}
        	},
        	preCheckUser:function(){
        		vm.user_login.error = false;
        		vm.user_login.msg = validator.checkNumber(vm.houseId,'磅房选择');
        		if(vm.user_login.msg != ''){
        			vm.user_login.error = true;
        			return;
        		}
        		vm.user_login.msg = validator.checkText(vm.user_login.userName,1,20,'用户名');
        		if(vm.user_login.msg != ''){
        			vm.user_login.error = true;
        			return;
        		}
        		vm.user_login.msg = validator.checkPassword(vm.user_login.userPwd,'密码');
        		if(vm.user_login.msg != ""){
        			vm.user_login.error = true;
        			return;
        		}
        	},
        	unSignin:function(){
        		vm.user_login.userName = '';
        		vm.user_login.userPwd = '';
        		vm.login_box_display = false;
        	},
        	toSignin:function(){
        		vm.login_box_display = true;
        	},
        	toReset:function(){
        		vm.is_reset = true;
        	},
        	userLocked:function(){
        		vm.user_login.userName = vm.user_info.userName;
        		vm.user_login.userPwd = '';
        		vm.lock_box_display = true;
        	},
        	exitProgram:function(){
        		$.post(logic_urls.exitProgram,{},
        			function(data){
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					window.location.href="/home/login/index.html";
        				}else{
        					TX.msg('关闭页面失败');
        					window.location.href="/home/login/index.html";
        				}
        			}
        		);
        	},
        	getNormalReport:function(){
        		TX.msg('正在读取数据',{time:200000});
        		vm.normal_report_list = [];
        		vm.normal_report_sum = 0;
        		vm.normal_report_cs = 0;
        		vm.normal_search.timeArea = vm.config.timeAreareport;
        		$.post(logic_urls.getNormalReport,vm.normal_search,
        			function(data){
        				var json = TX.toJson(data);
        				console.log(json);
        				if(json.status == 1){
        					layer.closeAll();
        					vm.normal_report_list = json.data;
        					vm.normal_report_sum = json.sum;
        					vm.normal_report_cs = json.cs;
        					avalon.scan();
        				}else{
        					TX.msg(json.msg);
        				}
        			}
        		);
        	},
        	exportNormalReport:function(){
        		if(vm.normal_report_list.length <= 0){
        			TX.msg('没有可导出的内容',{time:3000});
        			return false;
        		}
        		var sk = '';
        		for(var k in vm.normal_search){
        			sk = sk + k + '=' + vm.normal_search[k] + '&';
        		}
        		sk = sk.substr(0,sk.length - 1);
        		console.log(sk);
        		window.open(logic_urls.exportNormalReport + '?' + sk);
        	},
        	selectReport:function(){
        		console.log(vm.report_model);
        		if(vm.report_model == 'normalReport'){
        			if(vm.normal_search.houseId == ''){
        				vm.normal_search.houseId = vm.houseId;
        			}
        			if(vm.normal_search.fullOperator == ''){
        				vm.normal_search.fullOperator = vm.user_info.userName;
        			}
        			vm.getNormalReport();
        		}else{
        			vm.getCountReport();
        		}
        	},
        	enterChangeBillDate:function(){
        		var pd = [];
        		var sd = '';
        		for(var i=0;i<vm.change_list.length;i++){
        			if(vm.change_list[i]['select']){
        				pd.push(vm.change_list[i]['billId']);
        			}
        		}
        		if(pd.length == 0){
        			TX.msg('请选择要交班的磅单',{time:3000});
        			return;
        		}else{
        			sd = pd.join(',');
        		}
        		TX.msg('数据提交中...');
        		$.post(logic_urls.changeBillDate,{ids:sd},
        			function(data){
        				var json = TX.toJson(data);
        				layer.closeAll();
        				if(json.status == 1){
        					TX.msg('交班成功',{time:3000});
        					vm.change_dis = 'none';
        				}else{
        					TX.msg('交班失败，代码为：' + json.msg,{time:3000});
        				}
        			}
        		);
        	},
        	printDailyReport:function(id){
        		if(vm.normal_report_list.length <=0){
        			TX.msg('没有可以打印的内容',{time:3000});
        			return false;
        		}
        		reportPrint(id,vm.config);
        	},
        	changebillDate:function(){
        		vm.change_list = [];
        		vm.change_dis = 'block';
        		TX.msg('数据加载中...',{time:10000});
        		$.post(logic_urls.getWillChangeBillList,{houseId:vm.houseId},
        			function(data){
        				var json = TX.toJson(data);
        				if(json.status == 1){
        					layer.closeAll();
        					vm.change_list = json.data;
        					vm.changeAllList();
        					avalon.scan();
        				}else{
        					TX.msg('查询失败，代码为：' + json.msg,{time:3000});
        				}
        			}
        		)
        	},
        	changeAllList:function(){
        		if(vm.change_all){
        			vm.change_all = false;
        			for(var i=0;i<vm.change_list.length;i++){
	        			vm.change_list[i]['select'] = false;
	        		}
        		}else{
        			for(var i=0;i<vm.change_list.length;i++){
	        			vm.change_list[i]['select'] = true;
	        		}
	        		vm.change_all = true;
        		}        		
        	},
        	changeSelect:function(id){
        		vm.change_list[id].select = this.checked;
        	},
        	returnMain:function(){
        		vm.change_dis = "none";
        	},
        	printTest:function(){
        		createTable(vm.config);
        	},
        	test:function(){
        		//console.log(vm.config.codeType);
        		console.log(new Date().setDate('11'));
        	},
        	fillItem:function(obj,objName){
        		for(var k in obj){
        			if(obj[k]){
        				vm[objName][k] = obj[k];
        			}
        		}
        	},
        	getPositionSelect:function(){
        		vm.position_select = [];
        		var nm = vm.item.sendUnit;
        		var v=0;
        		for(var k=0;k<vm.customer_list.length;k++){
        			if(vm.customer_list[k]['customerName'] == nm){
        				v = vm.customer_list[k]['customerId'];
        				break;
        			}
        		}
        		if(v > 0){
        			for(var i=0;i<vm.position_list.length;i++){
        				if(vm.position_list[i]['customerId'] == v){
        					vm.position_select.push(vm.position_list[i]);
        				}
        			}
        		}
        		console.log(vm.position_select);
        	},
        	getEditPositionList:function(){
        		
        		vm.position_edit_select = [];
        		var nm = vm.weigh_edit.sendUnit;
        		var v=0;
        		for(var k=0;k<vm.customer_list.length;k++){
        			if(vm.customer_list[k]['customerName'] == nm){
        				v = vm.customer_list[k]['customerId'];
        				break;
        			}
        		}
        		console.log(v);
        		if(v > 0){
        			for(var i=0;i<vm.position_list.length;i++){
        				if(vm.position_list[i]['customerId'] == v){
        					vm.position_edit_select.push(vm.position_list[i]);
        				}
        			}
        		}
        		console.log(vm.position_edit_select);
        	},
        	printStr:function(){
        		var obj = {
        			billId:'52',
					billCode:'DLA201710270001',
					billDate:'2017-10-27',
					truckCode:'T01',
					emptyWeigh:15000,
					fullWeigh:75000,
					weigh:60000,
					emptyTime:'23:53:23',
					fullTime:'23:53:23',
					emptyOperator:'管理员',
					fullOperator:'管理员',
					driver:'二憨头',
					excavator:'360-1',
					goodsName:'矿石(硬)',
					receiveUnit:'破碎站',
					sendUnit:'三条沟平洞',
					truckType:'解放翻斗',
					printCount:1,
					mem:'',
					position:'470',
					houseId:vm.houseId,
					weighModel:vm.config.weighModel,
					weightype:vm.weightype,
					insert:vm.insert
        		};
        		orderPrint(vm.config,obj,0);
        	},
        	changeSystemDisplay:function(e){
        		vm.system_display = e;
        		console.log(e);
        	}
        });
        vm.load();
        function portInit(comset){
        	var cset = comset.baudRate + ',' + comset.checkBit + ',' + comset.dataBit + ',' + comset.stopBit;
        	tcom = new TComm(comset.portName, cset, 'utf-8');
        	tcom.OnDataIn = function (dat) { //接收串口返回数据
        		console.log(dat);
	            vm.dataProcess(dat.data);
	        }
	        tcom.Register("9060a7236f9a5ed7c764983a826076ebf6dfa1f115611d3934c58749de06036233bd174ef8756ec99f8b526d113733c2839427307b72ad00c6e9c18b0fa62918439522399f65257d", function (dat) {
	            if (dat==-99||dat.STAT == -99) {
	            	TX.msg('您还没有安装串口插件,请联系管理员');
	                /*if (confirm("您还没有安装串口插件\n\n现在下载安装吗？")) {
	                    location = "http://d.iyanhong.com/files/TComm2.exe";
	                }*/
	            } else if (dat.STAT == 11) {
	                tcom.init(function (ret) {
	                    if (ret.STAT == 1) {
	                        console.log('打开串口成功');
	                    } else {
	                        TX.msg("打开串口失败!",{icon:2,skin: 'layer-ext-moon'});
	                    }
	                });
	            } else {
	                TX.msg("注册失败,请与您的服务商联系!",{icon:3,skin:'layer-ext-moon'});
	            }
	        });

        }

        function getCode(str){
        	var vl = 0;
        	var chars = str.split('');
        	for(var i=0;i<chars.length;i++){
        		if(chars[i].length == 11){
        			vl = parseInt(chars[i].substr(1,7));
        			break;
        		}
        	}
        	/*var chars = str.split('');
        	if(chars.length > 0){
        		vl = parseInt(chars[1]);
        	}*/
        	return vl;
        }
        /*function orderPrint(config,obj){
        	var md = -1;
        	if(config.company){
        		obj.company = config.company;
        	}else{
        		obj.company = '';
        	}
			if(vm.weightype == 0){
				obj.weighOperator = obj.fullOperator;
			}else{
				obj.weighOperator = obj.emptyOperator;
			}
			var objstr = '<div style="display:block;width:96%;overflow:hidden;"><h2 style="width:100%;text-align:center;font-size:20px;">' + obj.company + '过磅单</h2><table border="0" style="width:96%;margin:0 auto;border-collapse:collapse;border-color:#000;"><tr><td align="left" style="width:50%;">过磅日期:&nbsp;' + obj.billDate + '</td><td align="right" style="">磅单编号:&nbsp;' + obj.billCode + '</td></tr></table><table border="1" style="width:96%;margin:0 auto;margin-top:10px;border-collapse:collapse;border-color:#000;"><tr><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">物资名称</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.goodsName + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">车牌号码</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.truckCode + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">司机姓名</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.driver + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">车辆型号</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.truckType + '</td></tr><tr><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;height:">皮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.emptyWeigh + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">毛&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.fullWeigh + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">净&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.weigh + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">钩&nbsp;&nbsp;机&nbsp;&nbsp;号</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.excavator + '</td></tr><tr><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;height:">检皮时间</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.emptyTime + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">检毛时间</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.fullTime + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">发货位置</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.position + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">发运路线</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.route + '</td></tr><tr><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;height:">发货单位</td><td colspan="3" align="center" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.sendUnit + '</td><td align="left" style="width:12.5%;padding-top:5px;padding-bottom:5px;">收货单位</td><td colspan="3" align="center" style="width:12.5%;padding-top:5px;padding-bottom:5px;">' + obj.receiveUnit + '</td></tr></table><table border="0" style="width:96%;margin:0 auto;border-collapse:collapse;border-color:#000;margin-top:10px;"><tr><td align="left" style="width:12.5%">司磅员:</td><td align="left" style="width:12.5%">' + obj.weighOperator + '</td><td align="center" style="width:12.5%">司机签字</td><td align="left" style="width:12.5%"></td><td align="center" style="width:12.5%">打印次数</td><td align="left" style="width:12.5%">' + obj.printCount + '</td><td align="center" style="width:12.5%">封条编号:</td><td align="left" style=""></td></tr></table></div>';
			if(!objstr) return;
			LODOP = getLodop();
			
			LODOP.PRINT_INIT('订单打印');
			if(md >= 0){
			LODOP.SET_PRINTER_INDEX(md);
			}
			LODOP.SET_PRINT_PAGESIZE(1,vm.codePagearea[0],vm.codePagearea[1],'');
			LODOP.ADD_PRINT_HTM(0,0,vm.codePrintarea[0],vm.codePrintarea[1],objstr);
			LODOP.PRINT();
        }*/
	});
	</script>
	<!--[if lt IE 9]>
	    <script src="__STATIC__/js/respond.js"></script>
	    <script src="__STATIC__/js/html5shiv.js"></script>
	    <script src="__STATIC__/js/placeholder-IE-fixes.js"></script>
	<![endif]-->
</body>
</html>